00001 00086 #ifndef __LIB3195_SBNVT_H_INCLUDED__ 00087 #define __LIB3195_SBNVT_H_INCLUDED__ 1 00088 #include "beepsession.h" 00089 00090 #define sbNVTRCHECKVALIDOBJECT(x) {assert(x != NULL); assert(x->OID == OIDsbNVTR);} 00091 #define sbNVTECHECKVALIDOBJECT(x) {assert(x != NULL); assert(x->OID == OIDsbNVTE);} 00092 00096 struct sbNVTEObject; 00097 struct sbStrBObject; 00098 struct sbNVTRObject 00099 { 00100 srObjID OID; 00101 struct sbNVTEObject *pFirst; 00102 struct sbNVTEObject *pLast; 00103 struct sbNVTEObject *pParent; 00104 }; 00105 typedef struct sbNVTRObject sbNVTRObj; 00106 00107 00116 struct sbNVTEObject 00117 { 00118 srObjID OID; 00119 struct sbNVTEObject *pNext; 00120 sbNVTRObj *pChild; 00121 sbNVTRObj *pXMLProps; 00122 void *pUsr; 00123 void (*pUsrDestroy)(void*); 00124 char *pszKey; 00125 unsigned uKey; 00126 int uKeyPresent; 00127 char *pszValue; 00128 unsigned uValue; 00129 int bIsSetUValue; 00130 char *pCDATA; 00131 }; 00132 typedef struct sbNVTEObject sbNVTEObj; 00133 00134 00142 void sbNVTRDestroy(sbNVTRObj* pThis); 00143 00157 void sbNVTEDestroy(sbNVTEObj* pThis); 00158 00166 sbNVTRObj* sbNVTRConstruct(void); 00167 00175 sbNVTEObj* sbNVTEConstruct(void); 00176 00189 sbNVTEObj* sbNVTUnlinkElement(sbNVTRObj* pRoot); 00190 00213 sbNVTEObj* sbNVTSearchKeySZ(sbNVTRObj* pRoot, sbNVTEObj* pStart, char* pszSearch); 00214 00234 sbNVTEObj* sbNVTSearchKeyU(sbNVTRObj* pRoot, sbNVTEObj* pStart, unsigned uSearch); 00235 00236 00250 srRetVal sbNVTESetKeySZ(sbNVTEObj* pThis, char* pszKey, int bCopy); 00251 00265 srRetVal sbNVTESetValueSZ(sbNVTEObj* pThis, char* pszVal, int bCopy); 00266 00271 srRetVal sbNVTESetKeyU(sbNVTEObj* pThis, unsigned uKey); 00272 00276 srRetVal sbNVTEUnsetKeyU(sbNVTEObj* pThis); 00277 00282 srRetVal sbNVTESetValueU(sbNVTEObj* pThis, unsigned uVal); 00283 00284 00298 srRetVal sbNVTESetUsrPtr(sbNVTEObj* pThis, void *pPtr, void(pPtrDestroy)(void*)); 00299 00300 00306 void sbNVTRUnlinkFromParent(sbNVTRObj *pRoot); 00307 00318 sbNVTEObj* sbNVTAddEntry(sbNVTRObj* pRoot); 00319 00320 00329 void sbNVTEUnsetUsrPtr(sbNVTEObj *pEntry); 00330 00342 srRetVal sbNVTRRemoveKeyU(sbNVTRObj *pRoot, unsigned uKey); 00343 00344 00358 sbNVTEObj *sbNVTRHasElement(sbNVTRObj* pRoot, char *pEltname, int bMustBeOnly); 00359 00360 00367 srRetVal sbNVTESetChild(sbNVTEObj *pEntry, sbNVTRObj *pChildRoot); 00368 00377 void sbNVTDebugPrintTree(sbNVTRObj *pRoot, int iLevel); 00378 00385 srRetVal sbNVTRRemoveFirst(sbNVTRObj* pRoot); 00386 00435 srRetVal sbNVTRParseXML(sbNVTRObj *pRoot, char *pszXML); 00436 00451 srRetVal sbNVTRRemovEntryWithpUsr(sbNVTRObj *pRoot, void* pUsr); 00452 00464 srRetVal sbNVTRRemoveKeyU(sbNVTRObj *pRoot, unsigned uKey); 00465 00476 void sbNVTEUnlinkFromList(sbNVTRObj *pRoot, sbNVTEObj* pEntry, sbNVTEObj* pPrev); 00477 00505 sbNVTEObj* sbNVTSearchpUsrAndPrev(sbNVTRObj* pRoot, sbNVTEObj* pStart, void *pUsr, sbNVTEObj** ppPrevEntry); 00506 00521 sbNVTEObj* sbNVTSearchKeyUAndPrev(sbNVTRObj* pRoot, sbNVTEObj* pStart, unsigned uSearch, sbNVTEObj** ppPrevEntry); 00522 00537 srRetVal sbNVTEGetValueU(sbNVTEObj* pThis, unsigned* puValue); 00538 00552 char* sbNVTXMLEscapePCDATA(char *pszToEscape); 00553 00554 00568 srRetVal sbNVTXMLEscapePCDATAintoStrB(char *pszToEscape, struct sbStrBObject *pStr); 00569 00577 char* sbNVTEUtilStrDup(char *pszStrToDup); 00578 00579 #endif