summaryrefslogtreecommitdiffstats
path: root/obj.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-29 10:23:10 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-29 10:23:10 +0000
commit19cad8b12fa34e05f903c1d55c77453be1bab431 (patch)
treea7f3a8c4ec25c1670530933aeea498330d3ab70a /obj.h
parent33a8ec9855b7e7674ab2b1a6e4814b08652296de (diff)
downloadrsyslog-19cad8b12fa34e05f903c1d55c77453be1bab431.tar.gz
rsyslog-19cad8b12fa34e05f903c1d55c77453be1bab431.tar.xz
rsyslog-19cad8b12fa34e05f903c1d55c77453be1bab431.zip
implemented naming for all objects (mostly as a debug aid, but you never
know what else it will be good for)
Diffstat (limited to 'obj.h')
-rw-r--r--obj.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/obj.h b/obj.h
index 6b965e10..3eb3f194 100644
--- a/obj.h
+++ b/obj.h
@@ -66,13 +66,13 @@
#define objSerializePTR(strm, propName, propType) \
CHKiRet(objSerializeProp(strm, (uchar*) #propName, PROPTYPE_##propType, (void*) pThis->propName));
#define DEFobjStaticHelpers static objInfo_t *pObjInfoOBJ = NULL;
-#define objGetName(pThis) (((obj_t*) (pThis))->pObjInfo->pszName)
+#define objGetClassName(pThis) (((obj_t*) (pThis))->pObjInfo->pszName)
#define objGetObjID(pThis) (((obj_t*) (pThis))->pObjInfo->objID)
#define objGetVersion(pThis) (((obj_t*) (pThis))->pObjInfo->iObjVers)
/* the next macro MUST be called in Constructors: */
#ifndef NDEBUG /* this means if debug... */
# define objConstructSetObjInfo(pThis) \
- assert(pThis->pObjInfo == NULL); \
+ ASSERT(((obj_t*) (pThis))->pObjInfo == NULL); \
((obj_t*) (pThis))->pObjInfo = pObjInfoOBJ; \
((obj_t*) (pThis))->iObjCooCKiE = 0xBADEFEE
#else
@@ -95,6 +95,8 @@ rsRetVal objEndSerialize(strm_t *pStrm);
rsRetVal objRegisterObj(objID_t oID, objInfo_t *pInfo);
rsRetVal objDeserialize(void *ppObj, objID_t objTypeExpected, strm_t *pStrm, rsRetVal (*fFixup)(obj_t*,void*), void *pUsr);
rsRetVal objDeserializePropBag(obj_t *pObj, strm_t *pStrm);
+rsRetVal objSetName(obj_t *pThis, uchar *pszName);
+uchar * objGetName(obj_t *pThis);
PROTOTYPEObjClassInit(obj);
#endif /* #ifndef OBJ_H_INCLUDED */