summaryrefslogtreecommitdiffstats
path: root/ctok_token.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-21 14:31:56 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-21 14:31:56 +0000
commit45136c665690534d934d0c0c188dbb18a0131b96 (patch)
tree50e774280a622de5dfc8b98707f0be6324aeb974 /ctok_token.c
parent04622f7d2210cbb8036502afadf5bcdcb0394d28 (diff)
downloadrsyslog-45136c665690534d934d0c0c188dbb18a0131b96.tar.gz
rsyslog-45136c665690534d934d0c0c188dbb18a0131b96.tar.xz
rsyslog-45136c665690534d934d0c0c188dbb18a0131b96.zip
some more interface changes
Diffstat (limited to 'ctok_token.c')
-rw-r--r--ctok_token.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/ctok_token.c b/ctok_token.c
index 11667323..a7acabd2 100644
--- a/ctok_token.c
+++ b/ctok_token.c
@@ -66,7 +66,7 @@ ENDobjDestruct(ctok_token)
* caller is responsible for destructing it.
* rgerhards, 2008-02-20
*/
-rsRetVal
+static rsRetVal
ctok_tokenUnlinkCStr(ctok_token_t *pThis, cstr_t **ppCStr)
{
DEFiRet;
@@ -80,6 +80,38 @@ ctok_tokenUnlinkCStr(ctok_token_t *pThis, cstr_t **ppCStr)
RETiRet;
}
+
+/* tell the caller if the supplied token is a compare operation */
+static int ctok_tokenIsCmpOp(ctok_token_t *pThis)
+{
+ return(pThis->tok >= ctok_CMP_EQ && pThis->tok <= ctok_CMP_GTEQ);
+}
+
+/* queryInterface function
+ * rgerhards, 2008-02-21
+ */
+BEGINobjQueryInterface(ctok_token)
+CODESTARTobjQueryInterface(ctok_token)
+ if(pIf->ifVersion != ctok_tokenCURR_IF_VERSION) { /* check for current version, increment on each change */
+ ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED);
+ }
+
+ /* ok, we have the right interface, so let's fill it
+ * Please note that we may also do some backwards-compatibility
+ * work here (if we can support an older interface version - that,
+ * of course, also affects the "if" above).
+ */
+ pIf->oID = OBJctok_token;
+
+ pIf->Construct = ctok_tokenConstruct;
+ pIf->ConstructFinalize = ctok_tokenConstructFinalize;
+ pIf->Destruct = ctok_tokenDestruct;
+ pIf->UnlinkCStr = ctok_tokenUnlinkCStr;
+ pIf->IsCmpOp = ctok_tokenIsCmpOp;
+finalize_it:
+ENDobjQueryInterface(ctok_token)
+
+
BEGINObjClassInit(ctok_token, 1) /* class, version */
OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, ctok_tokenConstructFinalize);
ENDObjClassInit(ctok_token)