summaryrefslogtreecommitdiffstats
path: root/var.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-22 17:44:47 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-22 17:44:47 +0000
commit75e9a2dc69bad2fe10cc60d801019731069005cf (patch)
tree605c12a4609dc68703fd6adf324aa1cc6e4b45d4 /var.h
parent44ac484dd18867163735c54d052e57d52142edaa (diff)
downloadrsyslog-75e9a2dc69bad2fe10cc60d801019731069005cf.zip
rsyslog-75e9a2dc69bad2fe10cc60d801019731069005cf.tar.gz
rsyslog-75e9a2dc69bad2fe10cc60d801019731069005cf.tar.xz
simplified var object, now only supports strings and numbers as a single
type
Diffstat (limited to 'var.h')
-rw-r--r--var.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/var.h b/var.h
index 0dbc9c6..40b3303 100644
--- a/var.h
+++ b/var.h
@@ -27,26 +27,21 @@
/* data types */
typedef enum {
VARTYPE_NONE = 0, /* currently no value set */
- VARTYPE_PSZ = 1,
- VARTYPE_SHORT = 2,
- VARTYPE_INT = 3,
- VARTYPE_LONG = 4,
- VARTYPE_INT64 = 5,
- VARTYPE_CSTR = 6,
- VARTYPE_SYSLOGTIME = 7
+ VARTYPE_STR = 1,
+ VARTYPE_NUMBER = 2,
+ VARTYPE_SYSLOGTIME = 3
} varType_t;
+typedef int64 number_t; /* type to use for numbers */
+
/* the var object */
typedef struct var_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
cstr_t *pcsName;
varType_t varType;
union {
- short vShort;
- int vInt;
- long vLong;
- int64 vInt64;
- cstr_t *vpCStr; /* used for both rsCStr and psz */
+ number_t num;
+ cstr_t *pStr;
syslogTime_t vSyslogTime;
} val;
@@ -59,7 +54,7 @@ BEGINinterface(var) /* name must also be changed in ENDinterface macro! */
rsRetVal (*Construct)(var_t **ppThis);
rsRetVal (*ConstructFinalize)(var_t __attribute__((unused)) *pThis);
rsRetVal (*Destruct)(var_t **ppThis);
- rsRetVal (*SetInt64)(var_t *pThis, int64 iVal);
+ rsRetVal (*SetNumber)(var_t *pThis, number_t iVal);
rsRetVal (*SetString)(var_t *pThis, cstr_t *pCStr);
rsRetVal (*ConvForOperation)(var_t *pThis, var_t *pOther);
ENDinterface(var)