liblogging: liblogging.h Source File

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

# liblogging.h

Go to the documentation of this file.

    00001
    00042 #ifndef __LIB3195_LIBLOGGING_H_INCLUDED__
    00043 #define __LIB3195_LIBLOGGING_H_INCLUDED__ 1
    00044 #include <stdio.h> /* debug only */
    00045
    00046 #include "config.h"
    00047 #ifdef __cplusplus
    00048 extern "C" {
    00049 #endif
    00050
    00054 #define LIBLOGGING_VERSION_MAJOR 0
    00055 #define LIBLOGGING_VERSION_MINOR 6
    00056 #define LIBLOGGING_VERSION_SUBMINOR 0
    00057
    00058
    00059 enum srRetVal_
    00060 {
    00061         SR_RET_ERR = -1,
    00062         SR_RET_REMAIN_WIN_TOO_SMALL = -2,
    00063         SR_RET_INVALID_HANDLE = -3,
    00068         SR_RET_INVALID_DESTRUCTOR = -4,
    00069         SR_RET_NOT_FOUND = - 5,
    00071     SR_RET_OUT_OF_MEMORY = -6,
    00072     SR_RET_XML_INVALID_PARAMTAG = -7,
    00073     SR_RET_XML_INVALID_TERMINATOR = -8,
    00074         SR_RET_XML_MALFORMED = -9,
    00075         SR_RET_MISSING_CLOSE_BRACE = -10,
    00076         SR_RET_XML_MISSING_CLOSETAG = -11,
    00077         SR_RET_XML_MISSING_OPENTAG = -12,
    00078         SR_RET_XML_TAG_MISMATCH = -13,
    00079         SR_RET_XML_INVALID_CDATA_HDR = -14,
    00080         SR_RET_XML_INVALID_CDATA_TRAIL = -14,
    00081         SR_RET_PEER_NONOK_RESPONSE = -15,
    00082         SR_RET_PEER_INVALID_PROFILE = -16,
    00083         SR_RET_PEER_NO_URI = -17,
    00084         SR_RET_PEER_NO_PROFILE = -18,
    00085         SR_RET_PEER_NO_GREETING = -19,
    00086         SR_RET_PEER_DOESNT_SUPPORT_PROFILE = -20,
    00087         SR_RET_INVALID_FRAME_STATE = -21,
    00088         SR_RET_PROFILE_ALREADY_SET = -22,
    00089         SR_RET_INVALID_CHAN_STATE = -23,
    00090         SR_RET_INVALID_GREETING = -24,
    00091         SR_RET_INVALID_CHAN0_MESG = -25,
    00092         SR_RET_START_MISSING_NUMBER = -26,
    00093         SR_RET_START_INVALID_NUMBER = -27,
    00094         SR_RET_START_EXISTING_NUMBER = -28,
    00095         SR_RET_NO_VALUE = -29,
    00096         SR_RET_START_EVEN_NUMBER = -30,
    00097         SR_RET_NO_PROFILE_RQSTD = -31,
    00098         SR_RET_WARNING_START_NO_PROFMATCH = -32,
    00099         SR_RET_ERR_EVENT_HANDLER_MISSING = -33,
    00100         SR_RET_ACKNO_ZERO = -34,
    00101         SR_RET_CHAN_DOESNT_EXIST = -35,
    00102         SR_RET_ALREADY_LISTENING = -36,
    00103         SR_RET_INVALID_OPTVAL = -37,
    00104         SR_RET_INVALID_LIB_OPTION = -38,
    00105         SR_RET_NULL_POINTER_PROVIDED = -39,
    00106         SR_RET_PROPERTY_NOT_AVAILABLE = -40,
    00107         SR_RET_UNSUPPORTED_FORMAT = -41,
    00108         SR_RET_UNALLOCATABLE_BUFFER = -42,
    00109         SR_RET_PRIO_OUT_OF_RANGE = -43,
    00110         SR_RET_FACIL_OUT_OF_RANGE = -44,
    00111         SR_RET_INVALID_TAG = -45,
    00112         SR_RET_NULL_MSG_PROVIDED = -46,
    00113         SR_RET_ERR_RECEIVE = -47,
    00114         SR_RET_UNEXPECTED_HDRCMD = -48,
    00115         SR_RET_PEER_INDICATED_ERROR = -49,
    00116         SR_RET_PROVIDED_BUFFER_TOO_SMALL = -50,
    00117         SR_RET_INVALID_PARAM = -51,
    00119         /* socket error codes */
    00120         SR_RET_SOCKET_ERR = -1001,
    00121         SR_RET_CANT_BIND_SOCKET = -1002,
    00122         SR_RET_INVALID_SOCKET = -1003,
    00123         SR_RET_CONNECTION_CLOSED = -1004,
    00124         SR_RET_INVALID_OS_SOCKETS_VERSION = -1005,
    00125         SR_RET_CAN_NOT_INIT_SOCKET = -1006,
    00126         SR_RET_UXDOMSOCK_CHMOD_ERR = -1007,
    00128         /* BEEP frame format & other errors */
    00129         SR_RET_INVALID_HDRCMD = -2001,
    00130         SR_RET_INVALID_WAITING_SP_CHAN = -2002,
    00131         SR_RET_INVALID_CHANNO = -2003,
    00132         SR_RET_INVALID_WAITING_SP_MSGNO = -2004,
    00133         SR_RET_INVALID_IN_MSGNO = -2005,
    00134         SR_RET_INVALID_WAITING_SP_MORE = -2006,
    00135         SR_RET_INVALID_IN_MORE = -2007,
    00136         SR_RET_INVALID_WAITING_SP_SEQNO = -2008,
    00137         SR_RET_INVALID_IN_SEQNO = -2009,
    00138         SR_RET_INVALID_WAITING_SP_SIZE = -2010,
    00139         SR_RET_INVALID_IN_SIZE = -2011,
    00140         SR_RET_INVALID_WAITING_SP_ANSNO = -2012,
    00141         SR_RET_INVALID_IN_ANSNO = -2013,
    00142         SR_RET_INVALID_WAITING_HDRCR = -2014,
    00143         SR_RET_INVALID_WAITING_HDRLF = -2015,
    00144         SR_RET_INVALID_IN_PAYLOAD = -2016,
    00145         SR_RET_INVALID_WAITING_END1 = -2017,
    00146         SR_RET_INVALID_WAITING_END2 = -2018,
    00147         SR_RET_INVALID_WAITING_END3 = -2019,
    00148         SR_RET_INVALID_WAITING_END4 = -2020,
    00149         SR_RET_INVALID_WAITING_END5 = -2021,
    00150         SR_RET_INVALID_WAITING_SP_ACKNO = -2022,
    00151         SR_RET_INVALID_WAITING_SP_WINDOW = -2023,
    00152         SR_RET_INAPROPRIATE_HDRCMD = -2024,
    00153         SR_RET_OVERSIZED_FRAME = -2025,
    00155         /* and finally the OK state... */
    00156         SR_RET_OK = 0
    00157 };
    00159 typedef enum srRetVal_ srRetVal;
    00160
    00161
    00162 typedef unsigned SBchannel;
    00163 typedef unsigned SBseqno;
    00164 typedef unsigned SBansno;
    00165 typedef unsigned SBsize;
    00166 typedef unsigned SBmsgno;
    00167 typedef unsigned SBackno;
    00168 typedef unsigned SBwindow;
    00178 enum srObjectID
    00179 {
    00180         OID_Freed = -1,
    00184         OID_Invalid = 0,
    00185         /* The 0xCDAB is a debug aid. It helps us find object IDs in memory
    00186          * dumps (on X86, this is ABCD in the dump ;)
    00187          * If you are on an embedded device and you would like to save space
    00188          * make them 1 byte only.
    00189          */
    00190         OIDsbFram = 0xCDAB0001,
    00191         OIDsbChan = 0xCDAB0002,
    00192         OIDsbMesg = 0xCDAB0003,
    00193         OIDsbSess = 0xCDAB0004,
    00194         OIDsbSock = 0xCDAB0005,
    00195         OIDsbProf = 0xCDAB0006,
    00196         OIDsrAPI  = 0xCDAB0007,
    00197         OIDsrSLMG = 0xCDAB0008,
    00198         OIDsbNVTR = 0xCDAB0009,
    00199         OIDsbNVTE = 0xCDAB000A,
    00200         OIDsbStrB = 0xCDAB000B,
    00201         OIDsbLstn = 0xCDAB000C,
    00202         OIDsbPSSR = 0xCDAB000D,
    00203         OIDsbPSRC = 0xCDAB000E
    00204 };
    00205 typedef enum srObjectID srObjID;
    00206
    00207
    00212 enum srOPTION3195Profiles_
    00213 {
    00214         USE_3195_PROFILE_ANY = 1,
    00215         USE_3195_PROFILE_RAW_ONLY = 2,
    00216         USE_3195_PROFILE_COOKED_ONLY = 3
    00217 };
    00218 typedef enum srOPTION3195Profiles_ srOPTION3195Profiles;
    00219
    00224 enum srOPTION
    00225 {
    00226         srOPTION_INVALID = 0,
    00237         srOPTION_CALL_OS_SOCKET_INITIALIZER = 1,
    00245          srOPTION_3195_ALLOWED_CLIENT_PROFILES = 2,
    00250          srOPTION_LISTEN_UDP = 3,
    00255      srOPTION_UPD_LISTENPORT = 4,
    00261      srOPTION_LISTEN_UXDOMSOCK = 5,
    00266      srOPTION_UXDOMSOCK_LISTENAME = 6,
    00272      srOPTION_LISTEN_BEEP = 7,
    00277      srOPTION_BEEP_LISTENPORT = 8
    00278 };
    00279 typedef enum srOPTION SRoption;
    00280
    00287 #if DEBUGLEVEL > 0
    00288 #define SRFREEOBJ(x) {(x)->OID = OID_Freed; free(x);}
    00289 #else
    00290 #define SRFREEOBJ(x) free(x)
    00291 #endif
    00292
    00297 enum BEEPHdrID_
    00298 {
    00299         BEEPHDR_UNKNOWN = 0,
    00300         BEEPHDR_ANS,
    00301         BEEPHDR_ERR,
    00302     BEEPHDR_MSG,
    00303         BEEPHDR_NUL,
    00304         BEEPHDR_RPY,
    00305         BEEPHDR_SEQ
    00306 };
    00307 typedef enum BEEPHdrID_ BEEPHdrID;
    00308
    00309
    00310 #define BEEP_DEFAULT_MIME_HDR "Content-type: application/beep+xml\r\n"
    00311
    00312 #ifdef __cplusplus
    00313 }
    00314 #endif
    00315 #include "srAPI.h"
    00316
    00317 #endif