summaryrefslogtreecommitdiffstats
path: root/ctok.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 08:48:20 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 08:48:20 +0000
commit0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (patch)
tree75456dcd5fd47274c2f5cd43eaebbbbe57865aab /ctok.h
parente2e775add92fae835119d132da33ea4ae0a5ae62 (diff)
downloadrsyslog-0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c.tar.gz
rsyslog-0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c.tar.xz
rsyslog-0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c.zip
created new class ctok_token
Diffstat (limited to 'ctok.h')
-rw-r--r--ctok.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/ctok.h b/ctok.h
index 1cddb68b..26dae5f1 100644
--- a/ctok.h
+++ b/ctok.h
@@ -24,45 +24,14 @@
#include "obj.h"
#include "stringbuf.h"
-
-/* the tokens... I use numbers below so that the tokens can be easier
- * identified in debug output. */
-typedef struct {
- enum {
- ctok_INVALID = 0,
- ctok_OR = 1,
- ctok_AND = 2,
- ctok_PLUS = 3,
- ctok_MINUS = 4,
- ctok_TIMES = 5, /* "*" */
- ctok_DIV = 6,
- ctok_MOD = 7,
- ctok_NOT = 8,
- ctok_RPAREN = 9,
- ctok_LPAREN = 10,
- ctok_COMMA = 11,
- ctok_SYSVAR = 12,
- ctok_MSGVAR = 13,
- ctok_SIMPSTR = 14,
- ctok_TPLSTR = 15,
- ctok_CMP_EQ = 16,
- ctok_CMP_NEQ = 17,
- ctok_CMP_LT = 18,
- ctok_CMP_GT = 19,
- ctok_CMP_LTEQ = 20,
- ctok_CMP_GTEQ = 21,
- ctok_NUMBER = 22,
- ctok_FUNCTION = 23
- } tok;
- rsCStrObj *pstrVal;
- int64 intVal;
-} ctok_token_t;
+#include "ctok_token.h"
/* the ctokession object */
typedef struct ctok_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
uchar *pp; /* this points to the next unread character, it is a reminescent of pp in
the config parser code ;) */
+ ctok_token_t *pUngotToken; /* buffer for ctokUngetToken(), NULL if not set */
} ctok_t;
@@ -71,7 +40,8 @@ rsRetVal ctokConstruct(ctok_t **ppThis);
rsRetVal ctokConstructFinalize(ctok_t __attribute__((unused)) *pThis);
rsRetVal ctokDestruct(ctok_t **ppThis);
rsRetVal ctokGetpp(ctok_t *pThis, uchar **pp);
-rsRetVal ctokGetNextToken(ctok_t *pThis, ctok_token_t *pToken);
+rsRetVal ctokGetToken(ctok_t *pThis, ctok_token_t **ppToken);
+rsRetVal ctokUngetToken(ctok_t *pThis, ctok_token_t *pToken);
PROTOTYPEObjClassInit(ctok);
PROTOTYPEpropSetMeth(ctok, pp, uchar*);