liblogging: srAPI.h Source File

Main Page | Compound List | File List | Compound Members | File Members | Related Pages

# srAPI.h

Go to the documentation of this file.

    00001
    00047 #ifndef __LIB3195_SRAPI_H_INCLUDED__
    00048 #define __LIB3195_SRAPI_H_INCLUDED__ 1
    00049
    00050 #ifdef __cplusplus
    00051 extern "C" {
    00052 #endif
    00053
    00054 #define srAPICHECKVALIDOBJECT(x) {assert(x != NULL); assert(x->OID == OIDsrAPI);}
    00055 struct srSLMGObject;
    00056
    00057 struct srAPIObject
    00061 {
    00062         srObjID OID;
    00063         struct sbChanObject *pChan;
    00064         struct sbNVTRObject *pProfsSupported;
    00065         struct sbSessObject *pSess;
    00066         void *pUsr;
    00068         srOPTION3195Profiles iUse3195Profiles;
    00069 #       if FEATURE_LISTENER == 1
    00070         int bListenBEEP;
    00071         int iBEEPListenPort;
    00072         void (*OnSyslogMessageRcvd)(struct srAPIObject* pAPI, struct srSLMGObject *pSyslogMesg);
    00073         struct sbLstnObject *pLstn;
    00074         int bListenUDP;
    00075         int iUDPListenPort;
    00076         int bListenUXDOMSOCK;
    00077         char *szNameUXDOMSOCK;
    00078 #       endif
    00079 };
    00080 typedef struct srAPIObject srAPIObj;
    00081
    00089 srAPIObj* srAPIInitLib(void);
    00090
    00098 srRetVal srAPIOpenlog(srAPIObj *pThis, char* pszRemotePeer, int iPort);
    00099
    00100
    00116 srRetVal srAPICloseLog(srAPIObj *pThis);
    00117
    00129 srRetVal srAPIExitLib(srAPIObj *pThis);
    00130
    00131
    00132
    00141 srRetVal srAPISendLogmsg(srAPIObj* pThis, char* szLogmsg);
    00142
    00157 srRetVal srAPISendSLMG(srAPIObj* pThis, struct srSLMGObject* pSLMG);
    00158
    00174 srRetVal srAPICloseLog(srAPIObj *pThis);
    00175
    00176
    00201 srRetVal srAPISetOption(srAPIObj* pThis, SRoption iOpt, int iOptVal);
    00202 /* And the same method for string options... */
    00203 srRetVal srAPISetStringOption(srAPIObj* pThis, SRoption iOpt, char *pszOptVal);
    00204
    00213 srRetVal srAPIRunListener(srAPIObj *pThis);
    00214
    00221 srRetVal srAPIShutdownListener(srAPIObj *pThis);
    00222
    00229 srRetVal srAPISetUsrPointer(srAPIObj *pAPI, void* pUsr);
    00230
    00238 srRetVal srAPIGetUsrPointer(srAPIObj *pAPI, void **ppToStore);
    00239
    00251 srRetVal srAPISetupListener(srAPIObj* pThis, void(*NewHandler)(srAPIObj*, struct srSLMGObject*));
    00252
    00265 srRetVal srAPISetMsgRcvCallback(srAPIObj* pThis, void(*NewHandler)(srAPIObj*, struct srSLMGObject*));
    00266
    00273 srRetVal srAPIShutdownListener(srAPIObj *pThis);
    00274
    00275
    00276 #ifdef __cplusplus
    00277 };
    00278 #endif
    00279
    00280 #endif