trunk: changeset 21

Fri, 21 Jul 2000 21:19:37 +0200

author
tuomov
date
Fri, 21 Jul 2000 21:19:37 +0200
changeset 18
afabe75987eb
parent 17
a034888a2227
child 19
3e498ec7abcd

trunk: changeset 21
Added 'bool' config file data type

include/libtu/tokenizer.h file | annotate | diff | comparison | revisions
--- a/include/libtu/tokenizer.h	Fri Jul 21 21:19:31 2000 +0200
+++ b/include/libtu/tokenizer.h	Fri Jul 21 21:19:37 2000 +0200
@@ -12,6 +12,7 @@
 #include "types.h"
 
 
+#define TOK_SET_BOOL(TOK, VAL) 		{(TOK)->type=TOK_BOOL; (TOK)->u.bval=VAL;}
 #define TOK_SET_LONG(TOK, VAL) 		{(TOK)->type=TOK_LONG; (TOK)->u.lval=VAL;}
 #define TOK_SET_DOUBLE(TOK, VAL) 	{(TOK)->type=TOK_DOUBLE; (TOK)->u.dval=VAL;}
 #define TOK_SET_CHAR(TOK, VAL) 		{(TOK)->type=TOK_CHAR; (TOK)->u.cval=VAL;}
@@ -21,6 +22,7 @@
 #define TOK_SET_OP(TOK, VAL) 		{(TOK)->type=TOK_OP; (TOK)->u.opval=VAL;}
 
 #define TOK_TYPE(TOK)				((TOK)->type)
+#define TOK_BOOL_VAL(TOK)			((TOK)->u.bval)
 #define TOK_LONG_VAL(TOK)			((TOK)->u.lval)
 #define TOK_DOUBLE_VAL(TOK)			((TOK)->u.dval)
 #define TOK_CHAR_VAL(TOK)			((TOK)->u.cval)
@@ -30,6 +32,7 @@
 #define TOK_OP_VAL(TOK)				((TOK)->u.opval)
 
 #define TOK_IS_INVALID(TOK)			((TOK)->type==TOK_INVALID)
+#define TOK_IS_BOOL(TOK)			((TOK)->type==TOK_BOOL)
 #define TOK_IS_LONG(TOK)			((TOK)->type==TOK_LONG)
 #define TOK_IS_DOUBLE(TOK)			((TOK)->type==TOK_DOUBLE)
 #define TOK_IS_CHAR(TOK)			((TOK)->type==TOK_CHAR)
@@ -52,6 +55,7 @@
 	TOK_CHAR,
 	TOK_STRING,
 	TOK_IDENT,
+	TOK_BOOL,
 	TOK_COMMENT,
 	TOK_OP
 };
@@ -96,6 +100,7 @@
 	int type;
 	int line;
 	union{
+		bool bval;
 		long lval;
 		double dval;
 		char cval;

mercurial