summaryrefslogtreecommitdiffstats
path: root/var.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-21 13:27:51 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-21 13:27:51 +0000
commit04622f7d2210cbb8036502afadf5bcdcb0394d28 (patch)
tree1ba5f0321aaf86f6050193dd8283d85a7f4acd39 /var.c
parent1cc790fae01e4392d4cf96820f6402528f611c44 (diff)
downloadrsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.tar.gz
rsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.tar.xz
rsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.zip
first steps in implementing object interfaces (stage work for later dynamic
class loading)
Diffstat (limited to 'var.c')
-rw-r--r--var.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/var.c b/var.c
index a7e71405..308bd684 100644
--- a/var.c
+++ b/var.c
@@ -104,7 +104,7 @@ varUnsetValues(var_t *pThis)
/* set a string value
*/
-rsRetVal
+static rsRetVal
varSetString(var_t *pThis, cstr_t *pCStr)
{
DEFiRet;
@@ -120,6 +120,31 @@ finalize_it:
}
+/* queryInterface function
+ * rgerhards, 2008-02-21
+ */
+BEGINobjQueryInterface(var)
+CODESTARTobjQueryInterface(var)
+ if(pIf->ifVersion != varCURR_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 = OBJvar;
+
+ pIf->Construct = varConstruct;
+ pIf->ConstructFinalize = varConstructFinalize;
+ pIf->Destruct = varDestruct;
+ pIf->DebugPrint = varDebugPrint;
+ pIf->SetString = varSetString;
+finalize_it:
+ENDobjQueryInterface(var)
+
+
/* Initialize the var class. Must be called as the very first method
* before anything else is called inside this class.
* rgerhards, 2008-02-19