TITLE

AUTHOR
Version 
CREATEDATE

Table of Contents

Table of contents

Hints about the C client library usage. 

The C client library
The xmlBlaster C client library supports access to xmlBlaster with asynchronous callbacks. Details about compilation and its usage can be found in the http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.c.socket.html requirement.
As a C developer your entry point to use is the struct XmlBlasterAccessUnparsed and a complete overview demo code is HelloWorld3.c
The C persistent queue
There is a C based persistent queue available. Currently this C client library and the queue implementation are used in the C++ client library for easy xmlBlaster connection and client side queuing. As a C developer your entry point to use is the struct I_QueueStruct and a source code example is TestQueue.c
For details read the http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.c.queue.html requirement.
The C++ client library
The C++ client library offers many extended client side features compared to the C library. If you need those additional features and the library size is not the primary concern you should consider to use the C++ library.
For details read the http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.cpp.html requirement and look at the API documentation at http://www.xmlblaster.org/xmlBlaster/doc/doxygen/cpp/html/index.html 

XmlBlaster  C  Client  Library Data Structure Index
XmlBlaster  C  Client  Library Data Structures
Here are the data structures with brief descriptions:
BlobHolder (Holds arbitrary raw data and its length ) 	pagenum
CallbackServerUnparsedStruct (This structure holds a complete callback server instance ) 	pagenum
DbInfoStruct (Holds Prepared statements for better performance ) 	pagenum
ExceptionStruct (Holds error text ) 	pagenum
I_QueueStruct (Interface for a queue implementation ) 	pagenum
ListenLoopArgsStruct (Auxiliary struct for passing parameters to listening threads ) 	pagenum
MsgRequestInfoStruct (Used to transport information back to callback functions ) 	pagenum
MsgUnit (Holds a message All member pointers are allocated with malloc(), you need to free() them Needs to be consistent with MsgUnitUnmanaged declaration in C# (for P/Invoke) ) 	pagenum
MsgUnitStructArr (Holds an array of Messages ) 	pagenum
PropertiesStruct (All client access to Properties goes over this struct and its function pointers ) 	pagenum
QosStructArr (Holds an array of QoS XML strings returned by unSubscribe() and erase() ) 	pagenum
QueueEntry (A struct holding the necessary queue entry informations used by I_Queue ) 	pagenum
QueueEntryStructArr (Holds an array of Messages ) 	pagenum
QueueProperties (The QueueProperty struct holds all configuration parameters of the queue to create ) 	pagenum
ResponseListenerStruct  	pagenum
SocketDataHolder (Helper struct to hold all necessary informations ) 	pagenum
TmpHelper (Used temporary for peekWithSamePriority() ) 	pagenum
UpdateContainer (Little helper to collect args for the new created thread ) 	pagenum
XmlBlasterAccessUnparsed (All client access to xmlBlaster goes over this struct and its function pointers ) 	pagenum
XmlBlasterConnectionUnparsedStruct (All synchrnous client access to xmlBlaster goes over this struct and its function pointers ) 	pagenum
XmlBlasterReadFromSocketFuncHolder (Holds a callback function pointer and its user pointer (the 'this' pointer) ) 	pagenum
XmlBlasterUnmanagedCEException (Usage without fixed array size, to avoid 'unsafe' code in C# ) 	pagenum
XmlBlasterUnmanagedCEStringArr (Helper struct to pass an array of strings back to C# ) 	pagenum
XmlBlasterUnmanagedException (Usage without fixed array size, to avoid 'unsafe' code in C# ) 	pagenum
XmlBlasterUnmanagedStringArr (Helper struct to pass an array of strings back to C# ) 	pagenum
XmlBlasterWriteToSocketFuncHolder (Holds a callback function pointer and its user pointer (the 'this' pointer, first argument) ) 	pagenum
XmlBlasterZlibReadBuffers (Helper struct to uncompress a byte buffer coming from the socket connection ) 	pagenum
XmlBlasterZlibWriteBuffers (Helper struct to compress a byte buffer before putting it into the socket ) 	pagenum

XmlBlaster  C  Client  Library File Index
XmlBlaster  C  Client  Library File List
Here is a list of all files with brief descriptions:demo/c/socket/Get.c  	pagenum
demo/c/socket/HelloWorld3.c  	pagenum
demo/c/socket/HelloWorldUdp.c  	pagenum
demo/c/socket/LogRedirect.c  	pagenum
demo/c/socket/Publisher.c  	pagenum
demo/c/socket/Subscriber.c  	pagenum
CallbackServerUnparsed.h  	pagenum
XmlBlasterAccessUnparsed.h  	pagenum
XmlBlasterConnectionUnparsed.h  	pagenum
XmlBlasterManaged.cpp  	pagenum
XmlBlasterManaged.h  	pagenum
XmlBlasterUnmanaged.h  	pagenum
XmlBlasterUnmanagedCE.h  	pagenum
socket/CallbackServerUnparsed.c  	pagenum
socket/XmlBlasterAccessUnparsed.c  	pagenum
socket/XmlBlasterConnectionUnparsed.c  	pagenum
socket/xmlBlasterSocket.c  	pagenum
socket/xmlBlasterSocket.h  	pagenum
socket/XmlBlasterUnmanaged.c  	pagenum
socket/XmlBlasterUnmanagedCE.c  	pagenum
socket/xmlBlasterZlib.c  	pagenum
socket/xmlBlasterZlib.h  	pagenum
util/basicDefs.h  	pagenum
util/helper.c  	pagenum
util/helper.h  	pagenum
util/msgUtil.c  	pagenum
util/msgUtil.h  	pagenum
util/Properties.c  	pagenum
util/Properties.h  	pagenum
util/queue/QueueInterface.h  	pagenum
util/queue/SQLiteQueue.c  	pagenum
testsuite/src/c/TestQueue.c  	pagenum

XmlBlaster  C  Client  Library Page Index
XmlBlaster  C  Client  Library Related Pages
Here is a list of all related documentation pages:Todo List	pagenum

XmlBlaster  C  Client  Library Data Structure Documentation
BlobHolder Struct Reference
Holds arbitrary raw data and its length. 
 #include <helper.h>
Data Fields
size_t dataLen
char * data

Detailed Description
Holds arbitrary raw data and its length. 

Definition at line 75 of file helper.h.
Field Documentation
size_t BlobHolder::dataLen

Definition at line 76 of file helper.h.
Referenced by blobcpyAlloc(), blobDump(), convertToXmlBlasterException(), encodeMsgUnit(), encodeMsgUnitArr(), encodeXmlBlasterException(), freeBlobHolderContent(), freeQueueEntryData(), parseQueueEntryArr(), parseSocketData(), persistentQueuePut(), persistentQueueRandomRemove(), postSendEvent(), preSendEvent(), queueEntryToXml(), responseEvent(), sendData(), sendResponse(), sendXmlBlasterException(), test_queue(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().char* BlobHolder::data

Definition at line 77 of file helper.h.
Referenced by blobcpyAlloc(), blobDump(), convertToXmlBlasterException(), encodeMsgUnit(), encodeXmlBlasterException(), freeBlobHolderContent(), freeQueueEntryData(), parseQueueEntryArr(), parseSocketData(), persistentQueuePut(), postSendEvent(), queueEntryToXml(), responseEvent(), sendData(), sendResponse(), sendXmlBlasterException(), test_queue(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
The documentation for this struct was generated from the following file:
util/helper.h

CallbackServerUnparsedStruct Struct Reference
This structure holds a complete callback server instance. 
 #include <CallbackServerUnparsed.h>
Collaboration diagram for CallbackServerUnparsedStruct:

IMAGE

Data Fields
Properties * props
int stopListenLoop
int listenSocket
int acceptSocket
int socketUdp
char * hostCB
int portCB
int reusingConnectionSocket
is false if we tunnel callback through the client connection socket 

XMLBLASTER_LOG_LEVEL logLevel
CallbackServerUnparsedLogging log
void * logUserP
For outside users to pass a user object back to their logging implementation. 

InitCallbackServer runCallbackServer
IsListening isListening
ShutdownCallbackServerRaw shutdown
For internal use (multi thread) only. 

UpdateCbFp updateCb
void * updateCbUserData
A optional pointer from the client code which is returned to the update() function call. 

UseThisSocket useThisSocket
ResponseListener responseListener [100]
AddResponseListener addResponseListener
RemoveResponseListener removeResponseListener
int isShutdown
CallbackServerUnparsedSendResponse sendResponse
CallbackServerUnparsedSendXmlBlasterException sendXmlBlasterException
CallbackServerUnparsedDoRespond sendResponseOrException
pthread_mutex_t listenMutex
XmlBlasterWriteToSocketFuncHolder writeToSocket
The function pointer to write n bytes of plain or compressed data to the socket Is initialized in initConnection(), outside users may choose to initialize it to some other function pointer. 

XmlBlasterReadFromSocketFuncHolder readFromSocket
Holding function pointer for compressed/uncompressed socket reads. 

Detailed Description
This structure holds a complete callback server instance. 

The function pointers like isListening() allow you to invoke methods on this structure. 
The function pointer updateCb() holds the clients callback function which is invoked when messages arrive. See the description of UpdateCbFp.  

Definition at line 107 of file CallbackServerUnparsed.h.
Field Documentation
Properties* CallbackServerUnparsedStruct::props

Definition at line 108 of file CallbackServerUnparsed.h.
Referenced by freeCallbackServerUnparsed(), and getCallbackServerUnparsed().int CallbackServerUnparsedStruct::stopListenLoop

Definition at line 109 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), listenLoop(), readMessage(), and shutdownCallbackServer().int CallbackServerUnparsedStruct::listenSocket

Definition at line 110 of file CallbackServerUnparsed.h.
Referenced by createCallbackServer(), getCallbackServerUnparsed(), isListening(), runCallbackServer(), shutdownCallbackServer(), and useThisSocket().int CallbackServerUnparsedStruct::acceptSocket

Definition at line 111 of file CallbackServerUnparsed.h.
Referenced by closeAcceptSocket(), createCallbackServer(), getCallbackServerUnparsed(), readMessage(), sendResponse(), sendXmlBlasterException(), and useThisSocket().int CallbackServerUnparsedStruct::socketUdp

Definition at line 112 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), listenLoop(), readMessage(), runCallbackServer(), and useThisSocket().char* CallbackServerUnparsedStruct::hostCB

Definition at line 113 of file CallbackServerUnparsed.h.
Referenced by createCallbackServer(), getCallbackServerUnparsed(), initialize(), main(), shutdownCallbackServer(), useThisSocket(), and xmlBlasterConnect().int CallbackServerUnparsedStruct::portCB

Definition at line 114 of file CallbackServerUnparsed.h.
Referenced by createCallbackServer(), getCallbackServerUnparsed(), initialize(), main(), useThisSocket(), and xmlBlasterConnect().int CallbackServerUnparsedStruct::reusingConnectionSocket
is false if we tunnel callback through the client connection socket 

Definition at line 115 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), handleMessage(), shutdownCallbackServer(), and useThisSocket().XMLBLASTER_LOG_LEVEL CallbackServerUnparsedStruct::logLevel

Definition at line 116 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), closeAcceptSocket(), createCallbackServer(), getCallbackServerUnparsed(), handleMessage(), listenLoop(), readMessage(), runCallbackServer(), sendResponse(), sendResponseOrException(), sendXmlBlasterException(), shutdownCallbackServer(), and useThisSocket().CallbackServerUnparsedLogging CallbackServerUnparsedStruct::log

Definition at line 117 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), closeAcceptSocket(), createCallbackServer(), getCallbackServerUnparsed(), handleMessage(), initialize(), listenLoop(), runCallbackServer(), sendResponse(), sendResponseOrException(), shutdownCallbackServer(), and useThisSocket().void* CallbackServerUnparsedStruct::logUserP
For outside users to pass a user object back to their logging implementation. 

Definition at line 118 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), closeAcceptSocket(), createCallbackServer(), getCallbackServerUnparsed(), handleMessage(), initialize(), listenLoop(), runCallbackServer(), sendResponse(), sendResponseOrException(), shutdownCallbackServer(), and useThisSocket().InitCallbackServer CallbackServerUnparsedStruct::runCallbackServer

Definition at line 125 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), and initialize().IsListening CallbackServerUnparsedStruct::isListening

Definition at line 126 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed().ShutdownCallbackServerRaw CallbackServerUnparsedStruct::shutdown
For internal use (multi thread) only. 

Definition at line 127 of file CallbackServerUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), and getCallbackServerUnparsed().UpdateCbFp CallbackServerUnparsedStruct::updateCb

Definition at line 128 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed().void* CallbackServerUnparsedStruct::updateCbUserData
A optional pointer from the client code which is returned to the update() function call. 

Definition at line 129 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), interceptUpdate(), sendResponse(), and sendXmlBlasterException().UseThisSocket CallbackServerUnparsedStruct::useThisSocket

Definition at line 130 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), and initialize().ResponseListener CallbackServerUnparsedStruct::responseListener[100]

Definition at line 131 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), getCallbackServerUnparsed(), getResponseListener(), handleMessage(), and removeResponseListener().AddResponseListener CallbackServerUnparsedStruct::addResponseListener

Definition at line 132 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), and preSendEvent().RemoveResponseListener CallbackServerUnparsedStruct::removeResponseListener

Definition at line 133 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), and postSendEvent().int CallbackServerUnparsedStruct::isShutdown

Definition at line 134 of file CallbackServerUnparsed.h.
Referenced by createCallbackServer(), freeXmlBlasterAccessUnparsed(), getCallbackServerUnparsed(), and runCallbackServer().CallbackServerUnparsedSendResponse CallbackServerUnparsedStruct::sendResponse

Definition at line 135 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed().CallbackServerUnparsedSendXmlBlasterException CallbackServerUnparsedStruct::sendXmlBlasterException

Definition at line 136 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed().CallbackServerUnparsedDoRespond CallbackServerUnparsedStruct::sendResponseOrException

Definition at line 137 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), interceptUpdate(), and runUpdate().pthread_mutex_t CallbackServerUnparsedStruct::listenMutex

Definition at line 138 of file CallbackServerUnparsed.h.
Referenced by listenLoop(), and runCallbackServer().XmlBlasterWriteToSocketFuncHolder CallbackServerUnparsedStruct::writeToSocket
The function pointer to write n bytes of plain or compressed data to the socket Is initialized in initConnection(), outside users may choose to initialize it to some other function pointer. 

Definition at line 141 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), initialize(), sendResponse(), and sendXmlBlasterException().XmlBlasterReadFromSocketFuncHolder CallbackServerUnparsedStruct::readFromSocket
Holding function pointer for compressed/uncompressed socket reads. 

Definition at line 145 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed(), initialize(), main(), readMessage(), shutdownCallbackServer(), and xmlBlasterUnmanagedCERegisterProgressListener().
The documentation for this struct was generated from the following file:
CallbackServerUnparsed.h

DbInfoStruct Struct Reference
Holds Prepared statements for better performance. 
 Collaboration diagram for DbInfoStruct:

IMAGE

Data Fields
QueueProperties prop
size_t numOfEntries
Meta information. 

int64_t numOfBytes
Cache for current number of entries. 

sqlite * db
Cache for current number of bytes. 

sqlite_vm * pVm_put
Database handle for SQLite. 

sqlite_vm * pVm_peekWithSamePriority
SQLite virtual machine to hold a prepared query. 

sqlite_vm * pVm_fillCache

Detailed Description
Holds Prepared statements for better performance. 

See also:
http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html 

Definition at line 108 of file SQLiteQueue.c.
Field Documentation
QueueProperties DbInfoStruct::prop

Definition at line 109 of file SQLiteQueue.c.
Referenced by fillCache(), getMaxNumOfBytes(), getMaxNumOfEntries(), getProperties(), persistentQueueClear(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), and persistentQueueRandomRemove().size_t DbInfoStruct::numOfEntries
Meta information. 

Definition at line 110 of file SQLiteQueue.c.
Referenced by createQueue(), fillCache(), getNumOfEntries(), parseCacheInfo(), persistentQueueClear(), persistentQueuePut(), and persistentQueueRandomRemove().int64_t DbInfoStruct::numOfBytes
Cache for current number of entries. 

Definition at line 111 of file SQLiteQueue.c.
Referenced by createQueue(), fillCache(), getNumOfBytes(), parseCacheInfo(), persistentQueueClear(), persistentQueuePut(), and persistentQueueRandomRemove().sqlite* DbInfoStruct::db
Cache for current number of bytes. 

Definition at line 112 of file SQLiteQueue.c.
Referenced by compilePreparedQuery(), execSilent(), persistentQueueInitialize(), persistentQueueRandomRemove(), and shutdownInternal().sqlite_vm* DbInfoStruct::pVm_put
Database handle for SQLite. 

Definition at line 113 of file SQLiteQueue.c.
Referenced by persistentQueuePut(), and shutdownInternal().sqlite_vm* DbInfoStruct::pVm_peekWithSamePriority
SQLite virtual machine to hold a prepared query. 

Definition at line 114 of file SQLiteQueue.c.
Referenced by persistentQueuePeekWithSamePriority(), and shutdownInternal().sqlite_vm* DbInfoStruct::pVm_fillCache

Definition at line 115 of file SQLiteQueue.c.
Referenced by fillCache(), and shutdownInternal().
The documentation for this struct was generated from the following file:
util/queue/SQLiteQueue.c

ExceptionStruct Struct Reference
Holds error text. 
 #include <helper.h>
Data Fields
int remote
true if exception is from remote (changed from bool to int to be C/C++ alignment compatible) 

char errorCode [56]
char message [1024]

Detailed Description
Holds error text. 

Definition at line 85 of file helper.h.
Field Documentation
int ExceptionStruct::remote
true if exception is from remote (changed from bool to int to be C/C++ alignment compatible) 

Definition at line 86 of file helper.h.
Referenced by convert(), convertToXmlBlasterException(), initializeExceptionStruct(), initializeXmlBlasterException(), interceptUpdate(), and parseSocketData().char ExceptionStruct::errorCode[56]

Definition at line 87 of file helper.h.
Referenced by checkArgs(), compilePreparedQuery(), convert(), convertToXmlBlasterException(), createQueue(), embedException(), encodeXmlBlasterException(), execSilent(), getExceptionStr(), getResultRows(), initConnection(), initialize(), initializeExceptionStruct(), initializeXmlBlasterException(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), parseCacheInfo(), parseQueueEntryArr(), parseSocketData(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), postSendEvent(), preSendEvent(), sendData(), sendResponseOrException(), sendXmlBlasterException(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPublish(), xmlBlasterSubscribe(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), xmlBlasterUnmanagedGet(), xmlBlasterUnmanagedUnSubscribe(), and xmlBlasterUnSubscribe().char ExceptionStruct::message[1024]

Definition at line 88 of file helper.h.
Referenced by checkArgs(), compilePreparedQuery(), convert(), convertToXmlBlasterException(), createQueue(), embedException(), encodeXmlBlasterException(), execSilent(), getExceptionStr(), initConnection(), initialize(), initializeExceptionStruct(), initializeXmlBlasterException(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), parseCacheInfo(), parseQueueEntryArr(), parseSocketData(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), postSendEvent(), preSendEvent(), sendData(), sendResponseOrException(), sendXmlBlasterException(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
The documentation for this struct was generated from the following file:
util/helper.h

I_QueueStruct Struct Reference
Interface for a queue implementation. 
 #include <QueueInterface.h>
Data Fields
void * userObject
I_QueueGetProperties getProperties
Access the configuration properties (readonly). 

I_QueuePut put
Puts a new entry into the queue. 

I_QueuePeekWithSamePriority peekWithSamePriority
Returns maximum the first num element in the queue of highest priority but does not remove it from that queue (leaves it untouched). 

I_QueueRandomRemove randomRemove
Removes the given entries from persistence. 

I_QueueClear clear
Clears (removes all entries) this queue. 

I_QueueShutdown shutdown
Shutdown the queue and free memory resources, no persistent entries are destroyed. 

I_QueueDestroy destroy
An administrative command to remove the backend store (e.g. 

I_QueueNumOfEntries getNumOfEntries
Access the current number of entries. 

I_QueueMaxNumOfEntries getMaxNumOfEntries
Access the configured maximum number of elements for this queue. 

I_QueueNumOfBytes getNumOfBytes
Returns the amount of bytes currently in the queue If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporarly not available) it will return -1. 

I_QueueMaxNumOfBytes getMaxNumOfBytes
Access the configured capacity (maximum bytes) for this queue. 

I_QueueEmpty empty
Check if queue is empty. 

XMLBLASTER_LOG_LEVEL logLevel
Set the logLevel to LOG_TRACE to get logging output. 

XmlBlasterLogging log
Assign your logging function pointer to receive logging output. 

I_QueueInitialize initialize
For internal use only. 

int isInitialized
void * privateObject
Hold current state of I_QueueStruct. 

Detailed Description
Interface for a queue implementation. 

See SQLiteQueue.c for a DB based persistent queue implementation. The 'I_' stands for 'interface'. 
See also:
The client.c.queue requirement 

Definition at line 88 of file QueueInterface.h.
Field Documentation
void* I_QueueStruct::userObject

Definition at line 90 of file QueueInterface.h.
Referenced by persistentQueueInitialize(), test_queue(), and xmlBlasterInitQueue().I_QueueGetProperties I_QueueStruct::getProperties
Access the configuration properties (readonly). 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
The queue configuration 

Definition at line 97 of file QueueInterface.h.
Referenced by createQueue(), and test_queue().I_QueuePut I_QueueStruct::put
Puts a new entry into the queue. 

Note that this method takes the entry pointed to by the argument and puts a reference to it into the queue. This means that you can not destroy the entry before the reference to it has been processed. 
Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
queueEntry The data of type QueueEntry to put into the queue Please initialize it with memset(&queueEntry, 0, sizeof(QueueEntry));  before setting your values so we can add new fields without breaking your code 
exception Check *exception.errorCode!=0 for errors: "user.illegalArgument", "resource.db.unavailable", "resource.db.block", "resource.db.unknown" "resource.overflow.queue.entries", "resource.overflow.queue.bytes" 

Definition at line 113 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueuePeekWithSamePriority I_QueueStruct::peekWithSamePriority
Returns maximum the first num element in the queue of highest priority but does not remove it from that queue (leaves it untouched). 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
maxNumOfEntries Access num entries, if -1 access all entries currently found 
maxNumOfBytes so many entries are returned as not to exceed the amount specified. If the first entry is bigger than this amount, it is returned anyway. -1 is unlimited. 
exception *exception.errorCode!=0 if the underlying implementation gets an exception: "user.illegalArgument", "resource.db.unavailable", "resource.db.block", "resource.db.unknown" 
Returns:
list with QueueEntry, the least elements with respect to the given time ordering or QueueEntryArr.len==0. Returned pointer is only NULL on exception 

Definition at line 129 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueueRandomRemove I_QueueStruct::randomRemove
Removes the given entries from persistence. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
queueEntryArr The entries to remove Please initialize each entry with memset(&queueEntry, 0, sizeof(QueueEntry));  (or use calloc() ) before setting your values so we can add new fields without breaking your code 
exception Check *exception.errorCode!=0 for errors: "user.illegalArgument", "resource.db.unavailable", "resource.db.block", "resource.db.unknown" "resource.overflow.queue.entries", "resource.overflow.queue.bytes" 
Returns:
The number of removed entries 

Definition at line 144 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueueClear I_QueueStruct::clear
Clears (removes all entries) this queue. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
exception Check *exception.errorCode!=0 for errors: "user.illegalArgument", "resource.db.unavailable", "resource.db.block", "resource.db.unknown" 
Returns:
true on success, if false *exception.errorCode is not 0 

Definition at line 154 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueueShutdown I_QueueStruct::shutdown
Shutdown the queue and free memory resources, no persistent entries are destroyed. 

The backend store is closed and all memory allocation are freed and the queueP is set to NULL
 NOTE: Your queueP is not usable anymore after this call. 
Parameters:
queuePP The pointer to your queue pointer, after freeing it is set to *queuePP=0 
exception *exception.errorCode!=0 if the underlying implementation gets an exception 

Definition at line 163 of file QueueInterface.h.
Referenced by createQueue().I_QueueDestroy I_QueueStruct::destroy
An administrative command to remove the backend store (e.g. 

clear all entries and the database files). 
Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
true on success, if false *exception.errorCode is not 0 

Definition at line 170 of file QueueInterface.h.
Referenced by createQueue(), and destroy().I_QueueNumOfEntries I_QueueStruct::getNumOfEntries
Access the current number of entries. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
The number of entries in the queue, returns -1 on error 

Definition at line 177 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueueMaxNumOfEntries I_QueueStruct::getMaxNumOfEntries
Access the configured maximum number of elements for this queue. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
The maximum number of elements in the queue, returns -1 when passing a NULL pointer 

Definition at line 184 of file QueueInterface.h.
Referenced by createQueue(), test_overflow(), and test_queue().I_QueueNumOfBytes I_QueueStruct::getNumOfBytes
Returns the amount of bytes currently in the queue If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporarly not available) it will return -1. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
The amount of bytes currently in the queue, returns -1 on error 

Definition at line 194 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().I_QueueMaxNumOfBytes I_QueueStruct::getMaxNumOfBytes
Access the configured capacity (maximum bytes) for this queue. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) 
Returns:
The maximum capacity for the queue in bytes, returns -1 when passing a NULL pointer 

Definition at line 201 of file QueueInterface.h.
Referenced by createQueue().I_QueueEmpty I_QueueStruct::empty
Check if queue is empty. 

Parameters:
queueP The 'this' pointer (similar to the hidden C++ 'this' pointer) returns true if the queue is empty, false otherwise 

Definition at line 208 of file QueueInterface.h.
Referenced by createQueue(), and test_illegal().XMLBLASTER_LOG_LEVEL I_QueueStruct::logLevel
Set the logLevel to LOG_TRACE to get logging output. 

Other levels are not supported 

Definition at line 214 of file QueueInterface.h.
Referenced by persistentQueueInitialize().XmlBlasterLogging I_QueueStruct::log
Assign your logging function pointer to receive logging output. 

See also:
xmlBlaster/demo/c/socket/LogRedirect.c for an example 

Definition at line 220 of file QueueInterface.h.
Referenced by persistentQueueInitialize().I_QueueInitialize I_QueueStruct::initialize
For internal use only. 

Returns:
false on error 

Definition at line 228 of file QueueInterface.h.
Referenced by createQueue().int I_QueueStruct::isInitialized

Definition at line 229 of file QueueInterface.h.
Referenced by checkArgs(), createQueue(), persistentQueueInitialize(), and test_queue().void* I_QueueStruct::privateObject
Hold current state of I_QueueStruct. 

Definition at line 230 of file QueueInterface.h.
Referenced by checkArgs(), createQueue(), createTables(), freeQueue(), and getDbInfo().
The documentation for this struct was generated from the following file:
util/queue/QueueInterface.h

ListenLoopArgsStruct Struct Reference
Auxiliary struct for passing parameters to listening threads. 
 #include <CallbackServerUnparsed.h>
Collaboration diagram for ListenLoopArgsStruct:

IMAGE

Data Fields
CallbackServerUnparsed * cb
int udp

Detailed Description
Auxiliary struct for passing parameters to listening threads. 

Definition at line 151 of file CallbackServerUnparsed.h.
Field Documentation
CallbackServerUnparsed* ListenLoopArgsStruct::cb

Definition at line 152 of file CallbackServerUnparsed.h.
Referenced by listenLoop(), and runCallbackServer().int ListenLoopArgsStruct::udp

Definition at line 153 of file CallbackServerUnparsed.h.
Referenced by listenLoop(), and runCallbackServer().
The documentation for this struct was generated from the following file:
CallbackServerUnparsed.h

MsgRequestInfoStruct Struct Reference
Used to transport information back to callback functions. 
 #include <msgUtil.h>
Collaboration diagram for MsgRequestInfoStruct:

IMAGE

Data Fields
void * xa
char requestIdStr [256]
const char * methodName
char responseType
XmlBlasterBlob blob
XmlBlasterBlob responseBlob
pthread_mutex_t responseMutex
int responseMutexIsLocked
pthread_cond_t responseCond
int rollback

Detailed Description
Used to transport information back to callback functions. 

Definition at line 80 of file msgUtil.h.
Field Documentation
void* MsgRequestInfoStruct::xa

Definition at line 81 of file msgUtil.h.
Referenced by mutexUnlock(), postSendEvent(), preSendEvent(), responseEvent(), and sendData().char MsgRequestInfoStruct::requestIdStr[256]

Definition at line 82 of file msgUtil.h.
Referenced by addResponseListener(), getResponseListener(), mutexUnlock(), postSendEvent(), preSendEvent(), removeResponseListener(), and sendData().const char* MsgRequestInfoStruct::methodName

Definition at line 83 of file msgUtil.h.
Referenced by mutexUnlock(), postSendEvent(), preSendEvent(), and sendData().char MsgRequestInfoStruct::responseType

Definition at line 84 of file msgUtil.h.
Referenced by postSendEvent(), responseEvent(), and sendData().XmlBlasterBlob MsgRequestInfoStruct::blob

Definition at line 85 of file msgUtil.h.
Referenced by postSendEvent(), and sendData().XmlBlasterBlob MsgRequestInfoStruct::responseBlob

Definition at line 86 of file msgUtil.h.
Referenced by postSendEvent(), preSendEvent(), and responseEvent().pthread_mutex_t MsgRequestInfoStruct::responseMutex

Definition at line 88 of file msgUtil.h.
Referenced by mutexUnlock(), postSendEvent(), preSendEvent(), and responseEvent().int MsgRequestInfoStruct::responseMutexIsLocked

Definition at line 89 of file msgUtil.h.
Referenced by mutexUnlock(), and preSendEvent().pthread_cond_t MsgRequestInfoStruct::responseCond

Definition at line 90 of file msgUtil.h.
Referenced by postSendEvent(), and responseEvent().int MsgRequestInfoStruct::rollback

Definition at line 92 of file msgUtil.h.
Referenced by postSendEvent(), and sendData().
The documentation for this struct was generated from the following file:
util/msgUtil.h

MsgUnit Struct Reference
Holds a message All member pointers are allocated with malloc(), you need to free() them Needs to be consistent with MsgUnitUnmanaged declaration in C# (for P/Invoke). 
 #include <msgUtil.h>
Data Fields
const char * key
XML formatted ASCII string of the message topic. 

size_t contentLen
Number of bytes in content. 

const char * content
Raw data (not 0 terminated). 

const char * qos
XML formatted ASCII string of Quality of Service. 

char * responseQos
Used to transport the response QoS string back to caller. 

Detailed Description
Holds a message All member pointers are allocated with malloc(), you need to free() them Needs to be consistent with MsgUnitUnmanaged declaration in C# (for P/Invoke). 

Definition at line 48 of file msgUtil.h.
Field Documentation
const char* MsgUnit::key
XML formatted ASCII string of the message topic. 

Definition at line 49 of file msgUtil.h.
Referenced by encodeMsgUnit(), encodeXmlBlasterException(), freeMsgUnitData(), interceptUpdate(), main(), messageUnitToXmlLimited(), myUpdate(), parseMsgUnitArr(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().size_t MsgUnit::contentLen
Number of bytes in content. 

Definition at line 50 of file msgUtil.h.
Referenced by encodeMsgUnit(), encodeMsgUnitArr(), freeMsgUnitData(), interceptUpdate(), main(), messageUnitToXmlLimited(), myUpdate(), parseMsgUnitArr(), sendXmlBlasterException(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().const char* MsgUnit::content
Raw data (not 0 terminated). 

Definition at line 51 of file msgUtil.h.
Referenced by encodeMsgUnit(), freeMsgUnitData(), interceptUpdate(), main(), messageUnitToXmlLimited(), myUpdate(), parseMsgUnitArr(), sendXmlBlasterException(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().const char* MsgUnit::qos
XML formatted ASCII string of Quality of Service. 

Definition at line 52 of file msgUtil.h.
Referenced by encodeMsgUnit(), encodeXmlBlasterException(), freeMsgUnitData(), interceptUpdate(), main(), messageUnitToXmlLimited(), myUpdate(), parseMsgUnitArr(), parseQosArr(), sendResponse(), sendXmlBlasterException(), xmlBlasterPublish(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().char* MsgUnit::responseQos
Used to transport the response QoS string back to caller. 

Definition at line 53 of file msgUtil.h.
Referenced by freeMsgUnitData(), interceptUpdate(), myUpdate(), sendResponse(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().
The documentation for this struct was generated from the following file:
util/msgUtil.h

MsgUnitStructArr Struct Reference
Holds an array of Messages. 
 #include <msgUtil.h>
Collaboration diagram for MsgUnitStructArr:

IMAGE

Data Fields
int isOneway
Oneway updates are marked with true. 

char secretSessionId [256]
Authenticate callback messages, this sessionId is returned by xmlBlaster and was initially passed from the client on login. 

uint32_t len
MsgUnit * msgUnitArr

Detailed Description
Holds an array of Messages. 

Definition at line 60 of file msgUtil.h.
Field Documentation
int MsgUnitStructArr::isOneway
Oneway updates are marked with true. 

Definition at line 62 of file msgUtil.h.
Referenced by interceptUpdate(), parseMsgUnitArr(), xmlBlasterUnmanagedCEPublishOneway(), and xmlBlasterUnmanagedPublishOneway().char MsgUnitStructArr::secretSessionId[256]
Authenticate callback messages, this sessionId is returned by xmlBlaster and was initially passed from the client on login. 

Definition at line 64 of file msgUtil.h.
Referenced by interceptUpdate(), xmlBlasterUnmanagedCEPublishOneway(), and xmlBlasterUnmanagedPublishOneway().uint32_t MsgUnitStructArr::len

Definition at line 65 of file msgUtil.h.
Referenced by encodeMsgUnitArr(), freeMsgUnitArrInternal(), interceptUpdate(), main(), myUpdate(), parseMsgUnitArr(), parseQosArr(), sendResponse(), xmlBlasterGet(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEPublishOneway(), xmlBlasterUnmanagedGet(), and xmlBlasterUnmanagedPublishOneway().MsgUnit* MsgUnitStructArr::msgUnitArr

Definition at line 66 of file msgUtil.h.
Referenced by encodeMsgUnitArr(), freeMsgUnitArrInternal(), interceptUpdate(), main(), myUpdate(), parseMsgUnitArr(), parseQosArr(), sendResponse(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEPublishOneway(), xmlBlasterUnmanagedGet(), and xmlBlasterUnmanagedPublishOneway().
The documentation for this struct was generated from the following file:
util/msgUtil.h

PropertiesStruct Struct Reference
All client access to Properties goes over this struct and its function pointers. 
 #include <Properties.h>
Data Fields
int argc
Number of argv. 

char ** argv
Pointer on the memory of the passed arguments. 

const char * execName
The executable name. 

XmlBlasterPropertiesGetString getString
Access command line settings of for "myExec -logLevel TRACE". Access a property as a string. 

XmlBlasterPropertiesGetBool getBool
Access a property converted to bool. 

XmlBlasterPropertiesGetInt getInt
Access a property converted to int. 

XmlBlasterPropertiesGetLong getLong
Access a property converted to long. 

XmlBlasterPropertiesGetInt64 getInt64
Access a property converted to a 64 bit long. 

Detailed Description
All client access to Properties goes over this struct and its function pointers. 

Definition at line 34 of file Properties.h.
Field Documentation
int PropertiesStruct::argc
Number of argv. 

Definition at line 35 of file Properties.h.
Referenced by createProperties(), dumpProperties(), freeProperties(), and getString().char** PropertiesStruct::argv
Pointer on the memory of the passed arguments. 

Definition at line 36 of file Properties.h.
Referenced by createProperties(), dumpProperties(), freeProperties(), and getString().const char* PropertiesStruct::execName
The executable name. 

Definition at line 37 of file Properties.h.
Referenced by createProperties().XmlBlasterPropertiesGetString PropertiesStruct::getString
Access command line settings of for "myExec -logLevel TRACE". Access a property as a string. 

If the key is not found the environment is checked, if this does not contain the key the defaultValue is returned. 
Parameters:
xb The 'this' pointer 
key e.g. "logLevel" 
defaultValue e.g. "WARN" 

Definition at line 46 of file Properties.h.
Referenced by createProperties(), getCallbackServerUnparsed(), getXmlBlasterAccessUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), main(), and xmlBlasterInitQueue().XmlBlasterPropertiesGetBool PropertiesStruct::getBool
Access a property converted to bool. 

Definition at line 47 of file Properties.h.
Referenced by createProperties(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initConnection(), and main().XmlBlasterPropertiesGetInt PropertiesStruct::getInt
Access a property converted to int. 

Definition at line 48 of file Properties.h.
Referenced by createProperties(), getCallbackServerUnparsed(), initConnection(), main(), and xmlBlasterInitQueue().XmlBlasterPropertiesGetLong PropertiesStruct::getLong
Access a property converted to long. 

Definition at line 49 of file Properties.h.
Referenced by createProperties(), getXmlBlasterAccessUnparsed(), and main().XmlBlasterPropertiesGetInt64 PropertiesStruct::getInt64
Access a property converted to a 64 bit long. 

Definition at line 50 of file Properties.h.
Referenced by createProperties(), and xmlBlasterInitQueue().
The documentation for this struct was generated from the following file:
util/Properties.h

QosStructArr Struct Reference
Holds an array of QoS XML strings returned by unSubscribe() and erase(). 
 #include <msgUtil.h>
Data Fields
uint32_t len
const char ** qosArr

Detailed Description
Holds an array of QoS XML strings returned by unSubscribe() and erase(). 

Definition at line 72 of file msgUtil.h.
Field Documentation
uint32_t QosStructArr::len

Definition at line 73 of file msgUtil.h.
Referenced by freeQosArr(), main(), parseQosArr(), xmlBlasterErase(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), xmlBlasterUnmanagedUnSubscribe(), and xmlBlasterUnSubscribe().const char** QosStructArr::qosArr

Definition at line 74 of file msgUtil.h.
Referenced by freeQosArr(), main(), parseQosArr(), xmlBlasterErase(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), xmlBlasterUnmanagedUnSubscribe(), and xmlBlasterUnSubscribe().
The documentation for this struct was generated from the following file:
util/msgUtil.h

QueueEntry Struct Reference
A struct holding the necessary queue entry informations used by I_Queue. 
 #include <QueueInterface.h>
Collaboration diagram for QueueEntry:

IMAGE

Data Fields
int64_t uniqueId
The unique key, used for sorting, usually a time stamp [nano sec]. 

int16_t priority
The priority of the queue entry, has higher sorting order than than the time stamp. 

int isPersistent
Mark an entry to be persistent, needed for cache implementations, 'T' is true, 'F' is false. 

int64_t sizeInBytes
The size of this entry which is given by the client and used to sum up queue->numOfBytes, if 0 we use the size of the blob. 

char embeddedType [28]
A string describing this entry, for example the format of the blob. 

BlobHolder embeddedBlob
blob.data is allocated with malloc, you need to free() it yourself, is compressed if marked as such 

Detailed Description
A struct holding the necessary queue entry informations used by I_Queue. 

Definition at line 47 of file QueueInterface.h.
Field Documentation
int64_t QueueEntry::uniqueId
The unique key, used for sorting, usually a time stamp [nano sec]. 

Is assumed to be ascending over time. 

Definition at line 48 of file QueueInterface.h.
Referenced by parseQueueEntryArr(), persistentQueuePut(), persistentQueueRandomRemove(), queueEntryToXml(), and test_queue().int16_t QueueEntry::priority
The priority of the queue entry, has higher sorting order than than the time stamp. 

Definition at line 49 of file QueueInterface.h.
Referenced by parseQueueEntryArr(), persistentQueuePut(), queueEntryToXml(), and test_queue().int QueueEntry::isPersistent
Mark an entry to be persistent, needed for cache implementations, 'T' is true, 'F' is false. 

'F' in persistent queue is a swapped transient entry 

Definition at line 50 of file QueueInterface.h.
Referenced by parseQueueEntryArr(), persistentQueuePut(), queueEntryToXml(), and test_queue().int64_t QueueEntry::sizeInBytes
The size of this entry which is given by the client and used to sum up queue->numOfBytes, if 0 we use the size of the blob. 

Definition at line 51 of file QueueInterface.h.
Referenced by persistentQueuePut(), and persistentQueueRandomRemove().char QueueEntry::embeddedType[28]
A string describing this entry, for example the format of the blob. 

Definition at line 52 of file QueueInterface.h.
Referenced by parseQueueEntryArr(), persistentQueuePut(), and queueEntryToXml().BlobHolder QueueEntry::embeddedBlob
blob.data is allocated with malloc, you need to free() it yourself, is compressed if marked as such 

Definition at line 53 of file QueueInterface.h.
Referenced by freeQueueEntryData(), parseQueueEntryArr(), persistentQueuePut(), persistentQueueRandomRemove(), queueEntryToXml(), and test_queue().
The documentation for this struct was generated from the following file:
util/queue/QueueInterface.h

QueueEntryStructArr Struct Reference
Holds an array of Messages. 
 #include <QueueInterface.h>
Collaboration diagram for QueueEntryStructArr:

IMAGE

Data Fields
size_t len
QueueEntry * queueEntryArr

Detailed Description
Holds an array of Messages. 

Definition at line 59 of file QueueInterface.h.
Field Documentation
size_t QueueEntryStructArr::len

Definition at line 60 of file QueueInterface.h.
Referenced by freeQueueEntryArrInternal(), parseQueueEntryArr(), persistentQueuePeekWithSamePriority(), persistentQueueRandomRemove(), test_illegal(), and test_queue().QueueEntry* QueueEntryStructArr::queueEntryArr

Definition at line 61 of file QueueInterface.h.
Referenced by freeQueueEntryArrInternal(), parseQueueEntryArr(), persistentQueuePeekWithSamePriority(), persistentQueueRandomRemove(), test_illegal(), and test_queue().
The documentation for this struct was generated from the following file:
util/queue/QueueInterface.h

QueueProperties Struct Reference
The QueueProperty struct holds all configuration parameters of the queue to create. 
 #include <QueueInterface.h>
Data Fields
char dbName [256]
The database name, for SQLite it is the file name on HD, "xmlBlaster.db". 

char queueName [256]
The name of the queue, "connection_client_joe". 

char tablePrefix [20]
The table prefix to use, "XB_". 

int32_t maxNumOfEntries
The max. 

int64_t maxNumOfBytes
The max. 

XmlBlasterLogging logFp
Your logging implementation or NULL if no logging callbacks are desired. 

XMLBLASTER_LOG_LEVEL logLevel
Set to LOG_TRACE to receive any logging. 

void * userObject
A pointer of your choice, is passed back when calling logFp in queueP->userObject. 

Detailed Description
The QueueProperty struct holds all configuration parameters of the queue to create. 

It is passed by the client code to create a queue. 

Definition at line 33 of file QueueInterface.h.
Field Documentation
char QueueProperties::dbName[256]
The database name, for SQLite it is the file name on HD, "xmlBlaster.db". 

Definition at line 34 of file QueueInterface.h.
Referenced by destroy(), persistentQueueDestroy(), persistentQueueInitialize(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().char QueueProperties::queueName[256]
The name of the queue, "connection_client_joe". 

Definition at line 35 of file QueueInterface.h.
Referenced by destroy(), fillCache(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().char QueueProperties::tablePrefix[20]
The table prefix to use, "XB_". 

Definition at line 36 of file QueueInterface.h.
Referenced by destroy(), fillCache(), persistentQueueClear(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().int32_t QueueProperties::maxNumOfEntries
The max. 

accepted entries, 10000 

Definition at line 37 of file QueueInterface.h.
Referenced by destroy(), getMaxNumOfEntries(), persistentQueueInitialize(), persistentQueuePut(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().int64_t QueueProperties::maxNumOfBytes
The max. 

capacity of the queue in bytes, 10000000LL 

Definition at line 38 of file QueueInterface.h.
Referenced by destroy(), getMaxNumOfBytes(), persistentQueueInitialize(), persistentQueuePut(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().XmlBlasterLogging QueueProperties::logFp
Your logging implementation or NULL if no logging callbacks are desired. 

Definition at line 39 of file QueueInterface.h.
Referenced by persistentQueueInitialize(), test_overflow(), test_queue(), and xmlBlasterInitQueue().XMLBLASTER_LOG_LEVEL QueueProperties::logLevel
Set to LOG_TRACE to receive any logging. 

Definition at line 40 of file QueueInterface.h.
Referenced by persistentQueueInitialize(), test_overflow(), test_queue(), and xmlBlasterInitQueue().void* QueueProperties::userObject
A pointer of your choice, is passed back when calling logFp in queueP->userObject. 

Definition at line 41 of file QueueInterface.h.
Referenced by persistentQueueInitialize(), test_overflow(), test_queue(), and xmlBlasterInitQueue().
The documentation for this struct was generated from the following file:
util/queue/QueueInterface.h

ResponseListenerStruct Struct Reference
#include <CallbackServerUnparsed.h>
Collaboration diagram for ResponseListenerStruct:

IMAGE

Data Fields
MsgRequestInfo * msgRequestInfoP
ResponseFp responseEventFp

Detailed Description

Definition at line 85 of file CallbackServerUnparsed.h.
Field Documentation
MsgRequestInfo* ResponseListenerStruct::msgRequestInfoP

Definition at line 86 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), getResponseListener(), handleMessage(), and removeResponseListener().ResponseFp ResponseListenerStruct::responseEventFp

Definition at line 89 of file CallbackServerUnparsed.h.
Referenced by addResponseListener().
The documentation for this struct was generated from the following file:
CallbackServerUnparsed.h

SocketDataHolder Struct Reference
Helper struct to hold all necessary informations. 
 #include <xmlBlasterSocket.h>
Collaboration diagram for SocketDataHolder:

IMAGE

Data Fields
size_t msgLen
int checksum
int compressed
char type
XMLBLASTER_MSG_TYPE. 

char version
char requestId [256]
char methodName [20]
char secretSessionId [256]
size_t dataLenUncompressed
XmlBlasterBlob blob
blob.data is allocated with malloc, you need to free() it yourself, is compressed if marked as such 

Detailed Description
Helper struct to hold all necessary informations. 

Definition at line 63 of file xmlBlasterSocket.h.
Field Documentation
size_t SocketDataHolder::msgLen

Definition at line 64 of file xmlBlasterSocket.h.
Referenced by parseSocketData().int SocketDataHolder::checksum

Definition at line 65 of file xmlBlasterSocket.h.int SocketDataHolder::compressed

Definition at line 66 of file xmlBlasterSocket.h.char SocketDataHolder::type
XMLBLASTER_MSG_TYPE. 

Definition at line 67 of file xmlBlasterSocket.h.
Referenced by handleMessage(), parseSocketData(), and responseEvent().char SocketDataHolder::version

Definition at line 68 of file xmlBlasterSocket.h.
Referenced by parseSocketData().char SocketDataHolder::requestId[256]

Definition at line 69 of file xmlBlasterSocket.h.
Referenced by handleMessage(), parseSocketData(), responseEvent(), sendResponse(), sendResponseOrException(), and sendXmlBlasterException().char SocketDataHolder::methodName[20]

Definition at line 70 of file xmlBlasterSocket.h.
Referenced by handleMessage(), parseSocketData(), sendResponse(), sendResponseOrException(), and sendXmlBlasterException().char SocketDataHolder::secretSessionId[256]

Definition at line 71 of file xmlBlasterSocket.h.
Referenced by parseSocketData(), sendResponse(), and sendXmlBlasterException().size_t SocketDataHolder::dataLenUncompressed

Definition at line 72 of file xmlBlasterSocket.h.
Referenced by parseSocketData().XmlBlasterBlob SocketDataHolder::blob
blob.data is allocated with malloc, you need to free() it yourself, is compressed if marked as such 

Definition at line 73 of file xmlBlasterSocket.h.
Referenced by handleMessage(), parseSocketData(), responseEvent(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
The documentation for this struct was generated from the following file:
socket/xmlBlasterSocket.h

TmpHelper Struct Reference
Used temporary for peekWithSamePriority(). 
 Collaboration diagram for TmpHelper:

IMAGE

Data Fields
QueueEntryArr ** queueEntryArrPP
int32_t currEntries
int64_t currBytes
int32_t maxNumOfEntries
int64_t maxNumOfBytes
The max wanted number of entries for this peek(). 

Detailed Description
Used temporary for peekWithSamePriority(). 

Definition at line 121 of file SQLiteQueue.c.
Field Documentation
QueueEntryArr** TmpHelper::queueEntryArrPP

Definition at line 122 of file SQLiteQueue.c.
Referenced by parseQueueEntryArr(), and persistentQueuePeekWithSamePriority().int32_t TmpHelper::currEntries

Definition at line 123 of file SQLiteQueue.c.
Referenced by parseQueueEntryArr().int64_t TmpHelper::currBytes

Definition at line 124 of file SQLiteQueue.c.
Referenced by parseQueueEntryArr().int32_t TmpHelper::maxNumOfEntries

Definition at line 125 of file SQLiteQueue.c.
Referenced by parseQueueEntryArr(), and persistentQueuePeekWithSamePriority().int64_t TmpHelper::maxNumOfBytes
The max wanted number of entries for this peek(). 

Definition at line 126 of file SQLiteQueue.c.
Referenced by parseQueueEntryArr(), and persistentQueuePeekWithSamePriority().
The documentation for this struct was generated from the following file:
util/queue/SQLiteQueue.c

UpdateContainer Struct Reference
Little helper to collect args for the new created thread. 
 Collaboration diagram for UpdateContainer:

IMAGE

Data Fields
XmlBlasterAccessUnparsed * xa
MsgUnitArr * msgUnitArrP
void * userData
XmlBlasterException exception
SocketDataHolder socketDataHolder

Detailed Description
Little helper to collect args for the new created thread. 

Definition at line 43 of file XmlBlasterAccessUnparsed.c.
Field Documentation
XmlBlasterAccessUnparsed* UpdateContainer::xa

Definition at line 44 of file XmlBlasterAccessUnparsed.c.
Referenced by interceptUpdate(), and runUpdate().MsgUnitArr* UpdateContainer::msgUnitArrP

Definition at line 45 of file XmlBlasterAccessUnparsed.c.
Referenced by interceptUpdate(), and runUpdate().void* UpdateContainer::userData

Definition at line 46 of file XmlBlasterAccessUnparsed.c.
Referenced by interceptUpdate(), and runUpdate().XmlBlasterException UpdateContainer::exception

Definition at line 47 of file XmlBlasterAccessUnparsed.c.
Referenced by interceptUpdate(), and runUpdate().SocketDataHolder UpdateContainer::socketDataHolder

Definition at line 48 of file XmlBlasterAccessUnparsed.c.
Referenced by interceptUpdate(), and runUpdate().
The documentation for this struct was generated from the following file:
socket/XmlBlasterAccessUnparsed.c

XmlBlasterAccessUnparsed Struct Reference
All client access to xmlBlaster goes over this struct and its function pointers. 
 #include <XmlBlasterAccessUnparsed.h>
Collaboration diagram for XmlBlasterAccessUnparsed:

IMAGE

Data Fields
int argc
The number of argv entries. 

const char *const * argv
Environment configuration, usually from the command line. 

Properties * props
Further configuration parameters. 

void * userObject
A client can use this pointer to point to any client specific information. 

XmlBlasterAccessGenericFp userFp
A client can use this function pointer to do any client specific handling. 

XmlBlasterAccessUnparsedConnect connect
Connect to the server. 

XmlBlasterAccessUnparsedInitialize initialize
Creates client side connection object and the callback server and does the low level IP connection. 

XmlBlasterAccessUnparsedDisconnect disconnect
Disconnect from server. 

XmlBlasterAccessUnparsedPublish publish
Publish a message. 

XmlBlasterAccessUnparsedPublishArr publishArr
Publish an array of messages. 

XmlBlasterAccessUnparsedPublishOneway publishOneway
Publish oneway an array of messages. 

XmlBlasterAccessUnparsedSubscribe subscribe
Subscribe to messages. 

XmlBlasterAccessUnparsedUnSubscribe unSubscribe
XmlBlasterAccessUnparsedErase erase
XmlBlasterAccessUnparsedGet get
XmlBlasterAccessUnparsedPing ping
XmlBlasterAccessUnparsedIsConnected isConnected
Check if we are connected to xmlBlaster. 

XMLBLASTER_LOG_LEVEL logLevel
XmlBlasterLogging log
void * logUserP
For outside users to pass a user object back to the logging implementation. 

XmlBlasterConnectionUnparsed * connectionP
CallbackServerUnparsed * callbackP
int isInitialized
int isShutdown
UpdateFp clientsUpdateFp
Here we asynchronously receive the callback from xmlBlaster. 

int callbackMultiThreaded
Shall update messages be transported to the client code in a thread per request? 

int lowLevelAutoAck
long responseTimeout
pthread_t callbackThreadId
char threadCounter
pthread_mutex_t writenMutex
Protect writing n bytes to the socket. 

pthread_mutex_t readnMutex
Protect reading n bytes from the socket. 

Detailed Description
All client access to xmlBlaster goes over this struct and its function pointers. 

All function pointers expect a 'this' pointer of type XmlBlasterAccessUnparsed and return XmlBlasterException::errorCode="communication.noConnection" if connection to xmlBlaster is lost.
Create an instance of XmlBlasterAccessUnparsed with a call to getXmlBlasterAccessUnparsed() and you are ready to access xmlBlaster. Don't forget to free everything when you don't need xmlBlaster access anymore with a call to freeXmlBlasterAccessUnparsed()
See HelloWorld3.c for a complete usage example.
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.c.socket.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 116 of file XmlBlasterAccessUnparsed.h.
Field Documentation
int XmlBlasterAccessUnparsed::argc
The number of argv entries. 

Definition at line 118 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), and initialize().const char* const* XmlBlasterAccessUnparsed::argv
Environment configuration, usually from the command line. 

Definition at line 119 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), and initialize().Properties* XmlBlasterAccessUnparsed::props
Further configuration parameters. 

Definition at line 120 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), and main().void* XmlBlasterAccessUnparsed::userObject
A client can use this pointer to point to any client specific information. 

Definition at line 121 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed().XmlBlasterAccessGenericFp XmlBlasterAccessUnparsed::userFp
A client can use this function pointer to do any client specific handling. 

Definition at line 122 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEInitialize(), xmlBlasterUnmanagedConnect(), and xmlBlasterUnmanagedInitialize().XmlBlasterAccessUnparsedConnect XmlBlasterAccessUnparsed::connect
Connect to the server. 

Parameters:
xa The 'this' pointer 
qos The QoS xml markup string to connect, typically 
 <qos>  <securityService type='htpasswd' version='1.0'>    <user>fritz</user>    <passwd>secret</passwd>  </securityService> <queue relating='callback' maxEntries='100' maxEntriesCache='100'>   <callback type='SOCKET' sessionId='s'>     socket://myServer.myCompany.com:6645   </callback> </queue> </qos> 
 
clientUpdateFp The clients callback function pointer UpdateFp, if NULL our default handler is used Is ignored if set by initialize already. 
The exception struct, exception->errorCode is filled on exception 
Returns:
The ConnectReturnQos raw xml string, you need to free() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.connect.html 

Definition at line 146 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEConnect(), and xmlBlasterUnmanagedConnect().XmlBlasterAccessUnparsedInitialize XmlBlasterAccessUnparsed::initialize
Creates client side connection object and the callback server and does the low level IP connection. 

This method is automatically called by connect() so you usually only call it explicitly if you are interested in the callback server settings. 
Parameters:
xa The 'this' pointer 
clientUpdateFp The clients callback handler function UpdateFp. If NULL our default handler is used 
Returns:
true on success 

Definition at line 155 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEInitialize(), and xmlBlasterUnmanagedInitialize().XmlBlasterAccessUnparsedDisconnect XmlBlasterAccessUnparsed::disconnect
Disconnect from server. 

Parameters:
xa The 'this' pointer 
qos The QoS xml markup string to disconnect 
The exception struct, exception->errorCode is filled on exception 
Returns:
false on exception 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 

Definition at line 164 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), myUpdate(), xmlBlasterUnmanagedCEDisconnect(), and xmlBlasterUnmanagedDisconnect().XmlBlasterAccessUnparsedPublish XmlBlasterAccessUnparsed::publish
Publish a message. 

Parameters:
xa The 'this' pointer to simulate C++ classes 
msgUnit The message of type MsgUnit you want to send. 
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr. 
Returns:
The QoS string with the response from xmlBlaster. You have to free it with a call to xmlBlasterFree. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it. 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 

Definition at line 176 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), myUpdate(), xmlBlasterUnmanagedCEPublish(), and xmlBlasterUnmanagedPublish().XmlBlasterAccessUnparsedPublishArr XmlBlasterAccessUnparsed::publishArr
Publish an array of messages. 

Parameters:
xa The 'this' pointer to simulate C++ classes 
msgUnitArr The messages of type MsgUnitArr you want to send. 
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr. 
Returns:
The QosArr struct with the response from xmlBlaster. You have to free it with a call to freeQosArr. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it. 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 

Definition at line 188 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPublishArr(), and xmlBlasterUnmanagedPublishArr().XmlBlasterAccessUnparsedPublishOneway XmlBlasterAccessUnparsed::publishOneway
Publish oneway an array of messages. 

Oneway messages don't return something, the server does not acknowledge (ACK) them.
Parameters:
xa The 'this' pointer to simulate C++ classes 
msgUnitArr The messages of type MsgUnitArr you want to send. 
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr. 
Returns:
The QosArr struct with the response from xmlBlaster. You have to free it with a call to freeQosArr. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it. 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 

Definition at line 202 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPublishOneway(), and xmlBlasterUnmanagedPublishOneway().XmlBlasterAccessUnparsedSubscribe XmlBlasterAccessUnparsed::subscribe
Subscribe to messages. 

Parameters:
xa The 'this' pointer to simulate C++ classes 
key The key xml string 
qos The QoS xml string 
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr. 
Returns:
The QoS string with the response from xmlBlaster. You have to free it with a call to xmlBlasterFree. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it. 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.subscribe.html 

Definition at line 215 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCESubscribe(), and xmlBlasterUnmanagedSubscribe().XmlBlasterAccessUnparsedUnSubscribe XmlBlasterAccessUnparsed::unSubscribe

Definition at line 216 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEUnSubscribe(), and xmlBlasterUnmanagedUnSubscribe().XmlBlasterAccessUnparsedErase XmlBlasterAccessUnparsed::erase

Definition at line 217 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEErase(), and xmlBlasterUnmanagedErase().XmlBlasterAccessUnparsedGet XmlBlasterAccessUnparsed::get

Definition at line 218 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().XmlBlasterAccessUnparsedPing XmlBlasterAccessUnparsed::ping

Definition at line 219 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPing(), and xmlBlasterUnmanagedPing().XmlBlasterAccessUnparsedIsConnected XmlBlasterAccessUnparsed::isConnected
Check if we are connected to xmlBlaster. 

Parameters:
xa The 'this' pointer 
Returns:
bool true or false 

Definition at line 225 of file XmlBlasterAccessUnparsed.h.
Referenced by checkArgs(), getXmlBlasterAccessUnparsed(), xmlBlasterUnmanagedCEIsConnected(), and xmlBlasterUnmanagedIsConnected().XMLBLASTER_LOG_LEVEL XmlBlasterAccessUnparsed::logLevel

Definition at line 226 of file XmlBlasterAccessUnparsed.h.
Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), mutexUnlock(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), and xmlBlasterConnect().XmlBlasterLogging XmlBlasterAccessUnparsed::log

Definition at line 227 of file XmlBlasterAccessUnparsed.h.
Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterLogger().void* XmlBlasterAccessUnparsed::logUserP
For outside users to pass a user object back to the logging implementation. 

Definition at line 228 of file XmlBlasterAccessUnparsed.h.
Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterLogger().XmlBlasterConnectionUnparsed* XmlBlasterAccessUnparsed::connectionP

Definition at line 230 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), isConnected(), readnCompressed(), writenCompressed(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().CallbackServerUnparsed* XmlBlasterAccessUnparsed::callbackP

Definition at line 231 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), main(), postSendEvent(), preSendEvent(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterProgressListener().int XmlBlasterAccessUnparsed::isInitialized

Definition at line 232 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), and initialize().int XmlBlasterAccessUnparsed::isShutdown

Definition at line 233 of file XmlBlasterAccessUnparsed.h.
Referenced by checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), and isConnected().UpdateFp XmlBlasterAccessUnparsed::clientsUpdateFp
Here we asynchronously receive the callback from xmlBlaster. 

NOTE: After this call the memory of MsgUnitArr is freed immediately by CallbackServerUnparsed. So you need to take a copy of all message members if needed out of the scope of this function.
Parameters:
msgUnitArr The messages of type MsgUnitArr from the server, use MsgUnit::responseQos to transport the return value. If responseQos is not NULL it will be free()'d as well by us. 
userData An optional pointer from the client with client specific data which is delivered back. Here userData is always the 'XmlBlasterAccessUnparsed *' pointer 
xmlBlasterException This points on a valid struct of type XmlBlasterException, so you only need to fill errorCode with strcpy and the returned pointer is ignored and the exception is thrown to xmlBlaster. 
Returns:
Return bool true if everything is OK Return false if you want to throw an exception, please fill XmlBlasterException in such a case. If false and *xmlBlasterException.errorCode==0 we don't send a return message (useful for update dispatcher thread to do it later) 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.update.html 
Todo:
Return void instead of bool 

Definition at line 254 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), and runUpdate().int XmlBlasterAccessUnparsed::callbackMultiThreaded
Shall update messages be transported to the client code in a thread per request? 

Definition at line 256 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), and myUpdate().int XmlBlasterAccessUnparsed::lowLevelAutoAck

Definition at line 257 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), and runUpdate().long XmlBlasterAccessUnparsed::responseTimeout

Definition at line 258 of file XmlBlasterAccessUnparsed.h.
Referenced by getXmlBlasterAccessUnparsed(), and postSendEvent().pthread_t XmlBlasterAccessUnparsed::callbackThreadId

Definition at line 259 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), and initialize().char XmlBlasterAccessUnparsed::threadCounter

Definition at line 260 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), interceptUpdate(), and runUpdate().pthread_mutex_t XmlBlasterAccessUnparsed::writenMutex
Protect writing n bytes to the socket. 

Definition at line 261 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), writenCompressed(), and writenPlain().pthread_mutex_t XmlBlasterAccessUnparsed::readnMutex
Protect reading n bytes from the socket. 

Definition at line 262 of file XmlBlasterAccessUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), readnCompressed(), and readnPlain().
The documentation for this struct was generated from the following file:
XmlBlasterAccessUnparsed.h

XmlBlasterConnectionUnparsedStruct Struct Reference
All synchrnous client access to xmlBlaster goes over this struct and its function pointers. 
 #include <XmlBlasterConnectionUnparsed.h>
Collaboration diagram for XmlBlasterConnectionUnparsedStruct:

IMAGE

Data Fields
int argc
const char *const * argv
Properties * props
int socketToXmlBlaster
int socketToXmlBlasterUdp
long requestId
char secretSessionId [256]
int isInitialized
XmlBlasterConnectionUnparsedInitConnection initConnection
Used internally or by multi threaded embedding only as this is called by connect() automatically. 

XmlBlasterConnectionUnparsedInitQueue initQueue
Call to initialize persistent queue support on lost connection. 

XmlBlasterConnectionUnparsedConnect connect
XmlBlasterConnectionUnparsedDisconnect disconnect
XmlBlasterConnectionUnparsedPublish publish
XmlBlasterConnectionUnparsedPublishArr publishArr
XmlBlasterConnectionUnparsedPublishOneway publishOneway
XmlBlasterConnectionUnparsedSubscribe subscribe
XmlBlasterConnectionUnparsedUnSubscribe unSubscribe
XmlBlasterConnectionUnparsedErase erase
XmlBlasterConnectionUnparsedGet get
XmlBlasterConnectionUnparsedPing ping
XmlBlasterConnectionUnparsedIsConnected isConnected
XmlBlasterConnectionUnparsedShutdown shutdown
XmlBlasterConnectionUnparsedPreSendEvent preSendEvent
If a callback function pointer is registered it will be called just before sending a message. 

void * preSendEvent_userP
XmlBlasterConnectionUnparsedPostSendEvent postSendEvent
If a callback function pointer is registered it will be called just after sending a message. 

void * postSendEvent_userP
I_Queue * queueP
XMLBLASTER_LOG_LEVEL logLevel
XmlBlasterLogging log
void * logUserP
For outside users to pass a user object back to the logging implementation. 

int useUdpForOneway
For publishOneway() AND to start callback UDP server (for updateOneway()). 

XmlBlasterWriteToSocketFuncHolder writeToSocket
The function pointer to write n bytes of plain or compressed data to the socket Is initialized in initConnection(), outside users may choose to initialize it to some other function pointer. 

XmlBlasterZlibWriteBuffers * zlibWriteBuf
Is null if no "zlib:stream" compression is switched on. 

XmlBlasterReadFromSocketFuncHolder readFromSocket
Holding function pointer for compressed/uncompressed socket reads. 

XmlBlasterZlibReadBuffers * zlibReadBuf
Is null if no "zlib:stream" compression is switched on. 

Detailed Description
All synchrnous client access to xmlBlaster goes over this struct and its function pointers. 

Definition at line 52 of file XmlBlasterConnectionUnparsed.h.
Field Documentation
int XmlBlasterConnectionUnparsedStruct::argc

Definition at line 53 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed().const char* const* XmlBlasterConnectionUnparsedStruct::argv

Definition at line 54 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed().Properties* XmlBlasterConnectionUnparsedStruct::props

Definition at line 55 of file XmlBlasterConnectionUnparsed.h.
Referenced by freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), and xmlBlasterInitQueue().int XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster

Definition at line 56 of file XmlBlasterConnectionUnparsed.h.
Referenced by getResponse(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), isConnected(), sendData(), and xmlBlasterConnectionShutdown().int XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp

Definition at line 57 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), sendData(), and xmlBlasterConnectionShutdown().long XmlBlasterConnectionUnparsedStruct::requestId

Definition at line 58 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and sendData().char XmlBlasterConnectionUnparsedStruct::secretSessionId[256]

Definition at line 59 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initConnection(), sendData(), xmlBlasterConnect(), and xmlBlasterDisconnect().int XmlBlasterConnectionUnparsedStruct::isInitialized

Definition at line 60 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and initConnection().XmlBlasterConnectionUnparsedInitConnection XmlBlasterConnectionUnparsedStruct::initConnection
Used internally or by multi threaded embedding only as this is called by connect() automatically. 

Definition at line 61 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and initialize().XmlBlasterConnectionUnparsedInitQueue XmlBlasterConnectionUnparsedStruct::initQueue
Call to initialize persistent queue support on lost connection. 

Definition at line 62 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed().XmlBlasterConnectionUnparsedConnect XmlBlasterConnectionUnparsedStruct::connect

Definition at line 63 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterConnect().XmlBlasterConnectionUnparsedDisconnect XmlBlasterConnectionUnparsedStruct::disconnect

Definition at line 64 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterDisconnect().XmlBlasterConnectionUnparsedPublish XmlBlasterConnectionUnparsedStruct::publish

Definition at line 65 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterPublish().XmlBlasterConnectionUnparsedPublishArr XmlBlasterConnectionUnparsedStruct::publishArr

Definition at line 66 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterPublishArr().XmlBlasterConnectionUnparsedPublishOneway XmlBlasterConnectionUnparsedStruct::publishOneway

Definition at line 67 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterPublishOneway().XmlBlasterConnectionUnparsedSubscribe XmlBlasterConnectionUnparsedStruct::subscribe

Definition at line 68 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterSubscribe().XmlBlasterConnectionUnparsedUnSubscribe XmlBlasterConnectionUnparsedStruct::unSubscribe

Definition at line 69 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterUnSubscribe().XmlBlasterConnectionUnparsedErase XmlBlasterConnectionUnparsedStruct::erase

Definition at line 70 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterErase().XmlBlasterConnectionUnparsedGet XmlBlasterConnectionUnparsedStruct::get

Definition at line 71 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterGet().XmlBlasterConnectionUnparsedPing XmlBlasterConnectionUnparsedStruct::ping

Definition at line 72 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterPing().XmlBlasterConnectionUnparsedIsConnected XmlBlasterConnectionUnparsedStruct::isConnected

Definition at line 73 of file XmlBlasterConnectionUnparsed.h.
Referenced by checkArgs(), getXmlBlasterConnectionUnparsed(), isConnected(), sendData(), and xmlBlasterConnectionShutdown().XmlBlasterConnectionUnparsedShutdown XmlBlasterConnectionUnparsedStruct::shutdown

Definition at line 74 of file XmlBlasterConnectionUnparsed.h.
Referenced by freeXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().XmlBlasterConnectionUnparsedPreSendEvent XmlBlasterConnectionUnparsedStruct::preSendEvent
If a callback function pointer is registered it will be called just before sending a message. 

Definition at line 75 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initialize(), and sendData().void* XmlBlasterConnectionUnparsedStruct::preSendEvent_userP

Definition at line 76 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initialize(), and sendData().XmlBlasterConnectionUnparsedPostSendEvent XmlBlasterConnectionUnparsedStruct::postSendEvent
If a callback function pointer is registered it will be called just after sending a message. 

Definition at line 77 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initialize(), and sendData().void* XmlBlasterConnectionUnparsedStruct::postSendEvent_userP

Definition at line 78 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and initialize().I_Queue* XmlBlasterConnectionUnparsedStruct::queueP

Definition at line 79 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterInitQueue().XMLBLASTER_LOG_LEVEL XmlBlasterConnectionUnparsedStruct::logLevel

Definition at line 80 of file XmlBlasterConnectionUnparsed.h.
Referenced by checkArgs(), freeXmlBlasterConnectionUnparsed(), getResponse(), getXmlBlasterConnectionUnparsed(), initConnection(), readnCompressed(), readnPlain(), sendData(), writenCompressed(), writenPlain(), xmlBlasterConnect(), xmlBlasterConnectionShutdown(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().XmlBlasterLogging XmlBlasterConnectionUnparsedStruct::log

Definition at line 81 of file XmlBlasterConnectionUnparsed.h.
Referenced by checkArgs(), freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), readnCompressed(), readnPlain(), sendData(), writenCompressed(), writenPlain(), xmlBlasterConnect(), xmlBlasterConnectionShutdown(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPing(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().void* XmlBlasterConnectionUnparsedStruct::logUserP
For outside users to pass a user object back to the logging implementation. 

Definition at line 82 of file XmlBlasterConnectionUnparsed.h.
Referenced by checkArgs(), freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), readnCompressed(), readnPlain(), sendData(), writenCompressed(), writenPlain(), xmlBlasterConnect(), xmlBlasterConnectionShutdown(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPing(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().int XmlBlasterConnectionUnparsedStruct::useUdpForOneway
For publishOneway() AND to start callback UDP server (for updateOneway()). 

Definition at line 83 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initConnection(), and xmlBlasterPublishOneway().XmlBlasterWriteToSocketFuncHolder XmlBlasterConnectionUnparsedStruct::writeToSocket
The function pointer to write n bytes of plain or compressed data to the socket Is initialized in initConnection(), outside users may choose to initialize it to some other function pointer. 

Definition at line 86 of file XmlBlasterConnectionUnparsed.h.
Referenced by getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), and sendData().struct XmlBlasterZlibWriteBuffers* XmlBlasterConnectionUnparsedStruct::zlibWriteBuf [read]
Is null if no "zlib:stream" compression is switched on. 

Definition at line 88 of file XmlBlasterConnectionUnparsed.h.
Referenced by freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), and writenCompressed().XmlBlasterReadFromSocketFuncHolder XmlBlasterConnectionUnparsedStruct::readFromSocket
Holding function pointer for compressed/uncompressed socket reads. 

Definition at line 91 of file XmlBlasterConnectionUnparsed.h.
Referenced by getResponse(), getXmlBlasterConnectionUnparsed(), initConnection(), and initialize().struct XmlBlasterZlibReadBuffers* XmlBlasterConnectionUnparsedStruct::zlibReadBuf [read]
Is null if no "zlib:stream" compression is switched on. 

Definition at line 92 of file XmlBlasterConnectionUnparsed.h.
Referenced by freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), and readnCompressed().
The documentation for this struct was generated from the following file:
XmlBlasterConnectionUnparsed.h

XmlBlasterReadFromSocketFuncHolder Struct Reference
Holds a callback function pointer and its user pointer (the 'this' pointer). 
 #include <helper.h>
Data Fields
XmlBlasterReadFromSocketFunc readFromSocketFuncP
void * userP
XmlBlasterNumReadFunc numReadFuncP
You can register a function pointer listener to be informed about the socket read progress. 

void * numReadUserP
This will be looped through to numReadFuncP. 

Detailed Description
Holds a callback function pointer and its user pointer (the 'this' pointer). 

Definition at line 42 of file helper.h.
Field Documentation
XmlBlasterReadFromSocketFunc XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP

Definition at line 43 of file helper.h.
Referenced by getCallbackServerUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), and parseSocketData().void* XmlBlasterReadFromSocketFuncHolder::userP

Definition at line 44 of file helper.h.
Referenced by getCallbackServerUnparsed(), getXmlBlasterConnectionUnparsed(), initialize(), and parseSocketData().XmlBlasterNumReadFunc XmlBlasterReadFromSocketFuncHolder::numReadFuncP
You can register a function pointer listener to be informed about the socket read progress. 

The function will be called than and again during reading the socket with the currently read bytes. Example: 
 static void progress(void *numReadUserP, const size_t currBytesRead, const size_t nbytes) {     printf("currBytesRead=%ld nbytes=%ld\n", (long)currBytesRead, (long)nbytes); } 
 The pointer may remain NULL. 

Definition at line 57 of file helper.h.
Referenced by getCallbackServerUnparsed(), main(), parseSocketData(), shutdownCallbackServer(), and xmlBlasterUnmanagedCERegisterProgressListener().void* XmlBlasterReadFromSocketFuncHolder::numReadUserP
This will be looped through to numReadFuncP. 

Definition at line 61 of file helper.h.
Referenced by getCallbackServerUnparsed(), main(), parseSocketData(), and xmlBlasterUnmanagedCERegisterProgressListener().
The documentation for this struct was generated from the following file:
util/helper.h

XmlBlasterUnmanagedCEException Struct Reference
Usage without fixed array size, to avoid 'unsafe' code in C#. 
 #include <XmlBlasterUnmanagedCE.h>
Data Fields
uint32_t remote
char * errorCode
char * message

Detailed Description
Usage without fixed array size, to avoid 'unsafe' code in C#. 

Definition at line 38 of file XmlBlasterUnmanagedCE.h.
Field Documentation
uint32_t XmlBlasterUnmanagedCEException::remote

Definition at line 39 of file XmlBlasterUnmanagedCE.h.
Referenced by convert(), interceptUpdate(), and xmlBlasterUnmanagedCEExceptionFree().char* XmlBlasterUnmanagedCEException::errorCode

Definition at line 40 of file XmlBlasterUnmanagedCE.h.
Referenced by convert(), interceptUpdate(), and xmlBlasterUnmanagedCEExceptionFree().char* XmlBlasterUnmanagedCEException::message

Definition at line 41 of file XmlBlasterUnmanagedCE.h.
Referenced by convert(), interceptUpdate(), and xmlBlasterUnmanagedCEExceptionFree().
The documentation for this struct was generated from the following file:
XmlBlasterUnmanagedCE.h

XmlBlasterUnmanagedCEStringArr Struct Reference
Helper struct to pass an array of strings back to C#. 
 #include <XmlBlasterUnmanagedCE.h>
Data Fields
const char * str

Detailed Description
Helper struct to pass an array of strings back to C#. 

Definition at line 66 of file XmlBlasterUnmanagedCE.h.
Field Documentation
const char* XmlBlasterUnmanagedCEStringArr::str

Definition at line 67 of file XmlBlasterUnmanagedCE.h.
Referenced by xmlBlasterUnmanagedCEErase(), and xmlBlasterUnmanagedCEUnSubscribe().
The documentation for this struct was generated from the following file:
XmlBlasterUnmanagedCE.h

XmlBlasterUnmanagedException Struct Reference
Usage without fixed array size, to avoid 'unsafe' code in C#. 
 #include <XmlBlasterUnmanaged.h>
Data Fields
uint32_t remote
char * errorCode
char * message

Detailed Description
Usage without fixed array size, to avoid 'unsafe' code in C#. 

Definition at line 36 of file XmlBlasterUnmanaged.h.
Field Documentation
uint32_t XmlBlasterUnmanagedException::remote

Definition at line 37 of file XmlBlasterUnmanaged.h.
Referenced by convert(), and interceptUpdate().char* XmlBlasterUnmanagedException::errorCode

Definition at line 38 of file XmlBlasterUnmanaged.h.
Referenced by convert(), and interceptUpdate().char* XmlBlasterUnmanagedException::message

Definition at line 39 of file XmlBlasterUnmanaged.h.
Referenced by convert(), and interceptUpdate().
The documentation for this struct was generated from the following file:
XmlBlasterUnmanaged.h

XmlBlasterUnmanagedStringArr Struct Reference
Helper struct to pass an array of strings back to C#. 
 #include <XmlBlasterUnmanaged.h>
Data Fields
const char * str

Detailed Description
Helper struct to pass an array of strings back to C#. 

Definition at line 45 of file XmlBlasterUnmanaged.h.
Field Documentation
const char* XmlBlasterUnmanagedStringArr::str

Definition at line 46 of file XmlBlasterUnmanaged.h.
Referenced by xmlBlasterUnmanagedErase(), and xmlBlasterUnmanagedUnSubscribe().
The documentation for this struct was generated from the following file:
XmlBlasterUnmanaged.h

XmlBlasterWriteToSocketFuncHolder Struct Reference
Holds a callback function pointer and its user pointer (the 'this' pointer, first argument). 
 #include <helper.h>
Data Fields
XmlBlasterWriteToSocketFunc writeToSocketFuncP
void * userP

Detailed Description
Holds a callback function pointer and its user pointer (the 'this' pointer, first argument). 

Definition at line 67 of file helper.h.
Field Documentation
XmlBlasterWriteToSocketFunc XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP

Definition at line 68 of file helper.h.
Referenced by getCallbackServerUnparsed(), getXmlBlasterConnectionUnparsed(), initConnection(), initialize(), sendData(), sendResponse(), and sendXmlBlasterException().void* XmlBlasterWriteToSocketFuncHolder::userP

Definition at line 69 of file helper.h.
Referenced by getCallbackServerUnparsed(), getXmlBlasterConnectionUnparsed(), initialize(), and sendData().
The documentation for this struct was generated from the following file:
util/helper.h

XmlBlasterZlibReadBuffers Struct Reference
Helper struct to uncompress a byte buffer coming from the socket connection. 
 #include <xmlBlasterZlib.h>
Data Fields
int debug
0: no debugging, 1: switch on debugging 

z_stream c_stream
zlib compression stream structure 

Bytef compBuffer [20000]
buffer to hold temporary the incoming compressed bytes 

Bytef * currCompBufferP
Pointer into compBuffer, points on current start position. 

uInt currCompBytes
Number of compressed bytes in compBuffer, starting at currCompBufferP. 

Detailed Description
Helper struct to uncompress a byte buffer coming from the socket connection. 

We need exactly one instance of this for each socket and the access must be synchronized to be thread safe.
Different instances of this struct are thread safe. 

Definition at line 53 of file xmlBlasterZlib.h.
Field Documentation
int XmlBlasterZlibReadBuffers::debug
0: no debugging, 1: switch on debugging 

Definition at line 54 of file xmlBlasterZlib.h.
Referenced by initConnection(), xmlBlaster_initZlibReader(), and xmlBlaster_readnCompressed().z_stream XmlBlasterZlibReadBuffers::c_stream
zlib compression stream structure 

Definition at line 56 of file xmlBlasterZlib.h.
Referenced by dumpZlib(), xmlBlaster_endZlibReader(), xmlBlaster_initZlibReader(), and xmlBlaster_readnCompressed().Bytef XmlBlasterZlibReadBuffers::compBuffer[20000]
buffer to hold temporary the incoming compressed bytes 

Definition at line 57 of file xmlBlasterZlib.h.
Referenced by dumpZlib(), xmlBlaster_initZlibReader(), and xmlBlaster_readnCompressed().Bytef* XmlBlasterZlibReadBuffers::currCompBufferP
Pointer into compBuffer, points on current start position. 

Definition at line 58 of file xmlBlasterZlib.h.
Referenced by dumpZlib(), xmlBlaster_initZlibReader(), and xmlBlaster_readnCompressed().uInt XmlBlasterZlibReadBuffers::currCompBytes
Number of compressed bytes in compBuffer, starting at currCompBufferP. 

Definition at line 59 of file xmlBlasterZlib.h.
Referenced by dumpZlib(), xmlBlaster_initZlibReader(), and xmlBlaster_readnCompressed().
The documentation for this struct was generated from the following file:
socket/xmlBlasterZlib.h

XmlBlasterZlibWriteBuffers Struct Reference
Helper struct to compress a byte buffer before putting it into the socket. 
 #include <xmlBlasterZlib.h>
Data Fields
int debug
0: no debugging, 1: switch on debugging 

z_stream c_stream
zlib compression stream structure 

Bytef compBuffer [20000]
buffer to hold temporary the outgoing compressed bytes 

Detailed Description
Helper struct to compress a byte buffer before putting it into the socket. 

We need exactly one instance of this for each socket and the access must be synchronized to be thread safe.
Different instances of this struct are thread safe. 
See also:
http://www.gzip.org/zlib/ 

Definition at line 34 of file xmlBlasterZlib.h.
Field Documentation
int XmlBlasterZlibWriteBuffers::debug
0: no debugging, 1: switch on debugging 

Definition at line 35 of file xmlBlasterZlib.h.
Referenced by initConnection(), xmlBlaster_endZlibWriter(), xmlBlaster_initZlibWriter(), and xmlBlaster_writenCompressed().z_stream XmlBlasterZlibWriteBuffers::c_stream
zlib compression stream structure 

Definition at line 37 of file xmlBlasterZlib.h.
Referenced by dumpZlib(), xmlBlaster_endZlibWriter(), xmlBlaster_initZlibWriter(), and xmlBlaster_writenCompressed().Bytef XmlBlasterZlibWriteBuffers::compBuffer[20000]
buffer to hold temporary the outgoing compressed bytes 

Definition at line 38 of file xmlBlasterZlib.h.
Referenced by xmlBlaster_writenCompressed().
The documentation for this struct was generated from the following file:
socket/xmlBlasterZlib.h

XmlBlaster  C  Client  Library File Documentation
demo/c/socket/Get.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for Get.c:

IMAGE

Functions
int main (int argc, char **argv)
Demo client to synchronous get messages. 

Function Documentation
int main (int argc, char ** argv)
Demo client to synchronous get messages. 

Not all GetQos functionality is implemented.
Access all messages: Get -xpath //key
Access all user names: Get -oid __sys__UserList
Access free memory: Get -oid __cmd:?freeMem
Access silently, useful for scripting: Get -oid __cmd:?freeMem -verbose false -sleep 0 -dumpRawContent true -logLevel WARN Get -oid __cmd:?topicList -verbose false -sleep 0 -dumpRawContent true -logLevel WARN Get -oid __cmd:?clientList -verbose false -sleep 0 -dumpRawContent true -logLevel WARN 

Definition at line 35 of file Get.c.
References XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeMsgUnitArr(), freeXmlBlasterAccessUnparsed(), XmlBlasterAccessUnparsed::get, PropertiesStruct::getBool, PropertiesStruct::getInt, PropertiesStruct::getLong, PropertiesStruct::getString, getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), XmlBlasterAccessUnparsed::initialize, ExceptionStruct::message, messageUnitToXmlLimited(), XmlBlasterAccessUnparsed::props, sleepMillis(), strFromBlobAlloc(), verbose, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE

demo/c/socket/HelloWorld3.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for HelloWorld3.c:

IMAGE

Functions
static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
Here we receive the callback messages from xmlBlaster. 

int main (int argc, char **argv)
Invoke: HelloWorld3 -logLevel TRACE. 

Function Documentation
int main (int argc, char ** argv)
Invoke: HelloWorld3 -logLevel TRACE. 

Definition at line 88 of file HelloWorld3.c.
References XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::connect, MsgUnit::content, MsgUnit::contentLen, XmlBlasterAccessUnparsed::disconnect, XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeArgv(), freeMsgUnitArr(), freeMsgUnitArrInternal(), freeMsgUnitData(), freeQosArr(), freeXmlBlasterAccessUnparsed(), XmlBlasterAccessUnparsed::get, getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), CallbackServerUnparsedStruct::hostCB, XmlBlasterAccessUnparsed::initialize, MsgUnit::key, QosStructArr::len, MsgUnitStructArr::len, ExceptionStruct::message, messageUnitToXmlLimited(), MsgUnitStructArr::msgUnitArr, myUpdate(), XmlBlasterAccessUnparsed::ping, CallbackServerUnparsedStruct::portCB, XmlBlasterAccessUnparsed::publish, XmlBlasterAccessUnparsed::publishArr, XmlBlasterAccessUnparsed::publishOneway, MsgUnit::qos, QosStructArr::qosArr, sleepMillis(), strcpyAlloc(), XmlBlasterAccessUnparsed::subscribe, XmlBlasterAccessUnparsed::unSubscribe, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
static int myUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * exception) [static]
Here we receive the callback messages from xmlBlaster. 

Parameters:
msgUnitArr The received messages, it is freed by the call after this method ends 
userData Is the corresponding XmlBlasterAccessUnparsed * pointer 
exception An OUT parameter to transport back an exception 
See also:
UpdateFp in XmlBlasterAccessUnparsed.h 
UpdateFp in CallbackServerUnparsed.h 

Definition at line 29 of file HelloWorld3.c.
References XmlBlasterAccessUnparsed::callbackMultiThreaded, MsgUnit::content, MsgUnit::contentLen, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeMsgUnitData(), freeXmlBlasterAccessUnparsed(), MsgUnit::key, MsgUnitStructArr::len, ExceptionStruct::message, messageUnitToXml(), MsgUnitStructArr::msgUnitArr, XmlBlasterAccessUnparsed::publish, MsgUnit::qos, MsgUnit::responseQos, strcpyAlloc(), strncpy0(), XMLBLASTEREXCEPTION_ERRORCODE_LEN, XMLBLASTEREXCEPTION_MESSAGE_LEN, and xmlBlasterFree().
Referenced by main().
Here is the call graph for this function:

IMAGE

demo/c/socket/HelloWorldUdp.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for HelloWorldUdp.c:

IMAGE

Functions
static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
Here we receive the callback messages from xmlBlaster. 

int main (int argc, char **argv)
Invoke: HelloWorldUdp -logLevel TRACE. 

Function Documentation
int main (int argc, char ** argv)
Invoke: HelloWorldUdp -logLevel TRACE. 

Definition at line 46 of file HelloWorldUdp.c.
References XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::connect, MsgUnit::content, MsgUnit::contentLen, XmlBlasterAccessUnparsed::disconnect, XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeMsgUnitArrInternal(), freeQosArr(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), CallbackServerUnparsedStruct::hostCB, XmlBlasterAccessUnparsed::initialize, MsgUnit::key, QosStructArr::len, MsgUnitStructArr::len, ExceptionStruct::message, MsgUnitStructArr::msgUnitArr, myUpdate(), CallbackServerUnparsedStruct::portCB, XmlBlasterAccessUnparsed::publishOneway, MsgUnit::qos, QosStructArr::qosArr, sleepMillis(), strcpyAlloc(), XmlBlasterAccessUnparsed::subscribe, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
static int myUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * exception) [static]
Here we receive the callback messages from xmlBlaster. 

Parameters:
msgUnitArr The received messages 
userData Is the corresponding XmlBlasterAccessUnparsed * pointer 
exception An OUT parameter to transport back an exception 
See also:
UpdateFp in XmlBlasterAccessUnparsed.h 
UpdateFp in CallbackServerUnparsed.h 

Definition at line 25 of file HelloWorldUdp.c.
References MsgUnitStructArr::len, messageUnitToXml(), MsgUnitStructArr::msgUnitArr, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE

demo/c/socket/LogRedirect.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for LogRedirect.c:

IMAGE

Functions
static void myLogger (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char *location, char *fmt,...)
Customized logging output is handled by this method. 

static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *xmlBlasterException)
Here we receive the callback messages from xmlBlaster. 

int main (int argc, char **argv)
Invoke: LogRedirect -logLevel TRACE. 

Function Documentation
int main (int argc, char ** argv)
Invoke: LogRedirect -logLevel TRACE. 

Definition at line 30 of file LogRedirect.c.
References XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, myLogger(), myUpdate(), XmlBlasterAccessUnparsed::ping, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
static void myLogger (void * logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char * location, char * fmt,  ...) [static]
Customized logging output is handled by this method. 

We register this function with  
 xa->log = myLogger; 
 
Parameters:
logUserP 0 or pointing to one of your supplied data struct 
currLevel The actual log level of the client 
level The level of this log entry 
location A string describing the code place 
fmt The formatting string 
... Other variables to log, corresponds to 'fmt' 
See also:
xmlBlaster/src/c/msgUtil.c: xmlBlasterDefaultLogging() is the default implementation 

Definition at line 125 of file LogRedirect.c.
References getLogLevelStr(), VSNPRINTF, and XMLBLASTER_LOG_TRACE.
Here is the call graph for this function:

IMAGE
static int myUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * xmlBlasterException) [static]
Here we receive the callback messages from xmlBlaster. 

Definition at line 172 of file LogRedirect.c.
References MsgUnitStructArr::len, messageUnitToXml(), MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, strcpyAlloc(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE

demo/c/socket/Publisher.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for Publisher.c:

IMAGE

Functions
static char * readFile (char *fn)
int main (int argc, char **argv)
Demo client to publish messages. 

Function Documentation
int main (int argc, char ** argv)
Demo client to publish messages. 

Not all PublishQos functionality is implemented. Invoke: Publisher -logLevel TRACE 

Definition at line 28 of file Publisher.c.
References XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::connect, MsgUnit::content, MsgUnit::contentLen, XmlBlasterAccessUnparsed::disconnect, XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeMsgUnitData(), freeQosArr(), freeXmlBlasterAccessUnparsed(), PropertiesStruct::getBool, PropertiesStruct::getInt, PropertiesStruct::getLong, PropertiesStruct::getString, getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), CallbackServerUnparsedStruct::hostCB, XmlBlasterAccessUnparsed::initialize, MsgUnit::key, QosStructArr::len, MsgUnitStructArr::len, ExceptionStruct::message, MsgUnitStructArr::msgUnitArr, CallbackServerUnparsedStruct::portCB, XmlBlasterAccessUnparsed::props, XmlBlasterAccessUnparsed::publish, XmlBlasterAccessUnparsed::publishOneway, MsgUnit::qos, QosStructArr::qosArr, readFile(), sleepMillis(), strcpyAlloc(), verbose, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
char * readFile (char * fn) [static]

Definition at line 321 of file Publisher.c.
Referenced by main().

demo/c/socket/Subscriber.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for Subscriber.c:

IMAGE

Functions
static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
Here we receive the callback messages from xmlBlaster. 

static void callbackProgressListener (void *userP, size_t currBytesRead, size_t nbytes)
Access the read socket progress. 

int main (int argc, char **argv)
Invoke examples:. 

Variables
static char * updateExceptionErrorCode = 0
static char * updateExceptionMessage = 0
static char * subscribeToken = 0
static char * queryType
static int message_counter = 1
static long updateSleep = 0l
static int reportUpdateProgress = 0
static int64_t startTimestamp = 0ll
static int verbose = 1

Function Documentation
static void callbackProgressListener (void * userP, size_t currBytesRead, size_t nbytes) [static]
Access the read socket progress. 

You need to register this function pointer if you want to see the progress of huge messages on slow connections. 

Definition at line 97 of file Subscriber.c.
References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, and XMLBLASTER_LOG_WARN.int main (int argc, char ** argv)
Invoke examples:. 

Subscriber -logLevel TRACE
Subscriber -session.name Subscriber/1 -dispatch/callback/retries -1 -subscribe/qos/persistent true -interactiveSubscribe true 

Definition at line 115 of file Subscriber.c.
References XmlBlasterAccessUnparsed::callbackP, callbackProgressListener(), XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeQosArr(), freeXmlBlasterAccessUnparsed(), PropertiesStruct::getBool, PropertiesStruct::getInt, PropertiesStruct::getLong, PropertiesStruct::getString, getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), CallbackServerUnparsedStruct::hostCB, XmlBlasterAccessUnparsed::initialize, QosStructArr::len, ExceptionStruct::message, myUpdate(), XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, CallbackServerUnparsedStruct::portCB, XmlBlasterAccessUnparsed::props, QosStructArr::qosArr, queryType, CallbackServerUnparsedStruct::readFromSocket, reportUpdateProgress, XmlBlasterAccessUnparsed::subscribe, subscribeToken, XmlBlasterAccessUnparsed::unSubscribe, updateExceptionErrorCode, updateExceptionMessage, updateSleep, verbose, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
static int myUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * exception) [static]
Here we receive the callback messages from xmlBlaster. 

See also:
UpdateFp in CallbackServerUnparsed.h 

Definition at line 31 of file Subscriber.c.
References ExceptionStruct::errorCode, getTimestamp(), MsgUnitStructArr::len, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, message_counter, messageUnitToXmlLimited(), MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, sleepMillis(), startTimestamp, strcpyAlloc(), strncpy0(), updateExceptionErrorCode, updateExceptionMessage, updateSleep, verbose, XMLBLASTER_LOG_INFO, XMLBLASTEREXCEPTION_ERRORCODE_LEN, XMLBLASTEREXCEPTION_MESSAGE_LEN, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE

Variable Documentation
int message_counter = 1 [static]

Definition at line 21 of file Subscriber.c.
Referenced by myUpdate().char* queryType [static]

Definition at line 20 of file Subscriber.c.
Referenced by main().int reportUpdateProgress = 0 [static]

Definition at line 23 of file Subscriber.c.
Referenced by main().int64_t startTimestamp = 0ll [static]

Definition at line 24 of file Subscriber.c.
Referenced by myUpdate().char* subscribeToken = 0 [static]

Definition at line 19 of file Subscriber.c.
Referenced by main().char* updateExceptionErrorCode = 0 [static]

Definition at line 17 of file Subscriber.c.
Referenced by main(), and myUpdate().char* updateExceptionMessage = 0 [static]

Definition at line 18 of file Subscriber.c.
Referenced by main(), and myUpdate().long updateSleep = 0l [static]

Definition at line 22 of file Subscriber.c.
Referenced by main(), and myUpdate().int verbose = 1 [static]

Definition at line 25 of file Subscriber.c.
Referenced by main(), and myUpdate().

CallbackServerUnparsed.h File Reference
#include <util/msgUtil.h>
#include <util/Properties.h>
#include "socket/xmlBlasterSocket.h"

Include dependency graph for CallbackServerUnparsed.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct ResponseListenerStruct
struct CallbackServerUnparsedStruct
This structure holds a complete callback server instance. 

struct ListenLoopArgsStruct
Auxiliary struct for passing parameters to listening threads. 

Defines
#define DEFAULT_CALLBACK_SERVER_PORT  7611
#define MAX_RESPONSE_LISTENER_SIZE  100
Typedefs
typedef CallbackServerUnparsedStruct CallbackServerUnparsed
typedef int(*) UseThisSocket (CallbackServerUnparsed *cb, int socketToUse, int socketToUseUdp)
Use this function directly after creation of the callback server if you want to force to reuse the given socket for callbacks. 

typedef int(*) InitCallbackServer (CallbackServerUnparsed *cb)
typedef int(*) IsListening (CallbackServerUnparsed *cb)

Returns:
true if the socket is open and waits for callback messages 

typedef void(*) UpdateCbFp (MsgUnitArr *msg, void *userData, XmlBlasterException *xmlBlasterException, void *socketDataHolder)
Here we asynchronously receive the callback from xmlBlaster. 

typedef void(*) ShutdownCallbackServerRaw (CallbackServerUnparsed *cb)
typedef void(*) CallbackServerUnparsedSendResponse (CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArr)
typedef void(*) CallbackServerUnparsedSendXmlBlasterException (CallbackServerUnparsed *cb, void *socketDataHolder, XmlBlasterException *exception)
typedef void(*) CallbackServerUnparsedDoRespond (int success, CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArrP, XmlBlasterException *exception)
typedef void(*) ResponseFp (MsgRequestInfo *msgRequestInfoP, void *socketDataHolder)
typedef ResponseListenerStruct ResponseListener
typedef int(*) AddResponseListener (CallbackServerUnparsed *cb, MsgRequestInfo *msgRequestInfoP, ResponseFp responseEventFp)
typedef ResponseListener *(*) RemoveResponseListener (CallbackServerUnparsed *cb, const char *requestId)
typedef void(*) CallbackServerUnparsedLogging (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char *location, const char *fmt,...)
typedef ListenLoopArgsStruct ListenLoopArgs
Auxiliary struct for passing parameters to listening threads. 

typedef void *(*) cbFp (void *)
Function pointer for pthread, the method to invoke on thread creation. 

Functions
CallbackServerUnparsed * getCallbackServerUnparsed (int argc, const char *const *argv, UpdateCbFp updateCb, void *userData)
Get a new instance of a callback server struct. 

void freeCallbackServerUnparsed (CallbackServerUnparsed **callbackData)
free() the CallbackServerUnparsed structure and sets *callbackData to 0 Call freeCallbackServerUnparsed(&cb); 

const char * callbackServerRawUsage ()
Help on configuration. 

Define Documentation
#define DEFAULT_CALLBACK_SERVER_PORT  7611

Definition at line 29 of file CallbackServerUnparsed.h.
Referenced by getCallbackServerUnparsed().#define MAX_RESPONSE_LISTENER_SIZE  100

Definition at line 81 of file CallbackServerUnparsed.h.
Referenced by addResponseListener(), getCallbackServerUnparsed(), getResponseListener(), handleMessage(), and removeResponseListener().
Typedef Documentation
typedef int( * ) AddResponseListener(CallbackServerUnparsed *cb, MsgRequestInfo *msgRequestInfoP, ResponseFp responseEventFp)

Definition at line 92 of file CallbackServerUnparsed.h.typedef struct CallbackServerUnparsedStruct CallbackServerUnparsed

Definition at line 34 of file CallbackServerUnparsed.h.typedef void( * ) CallbackServerUnparsedDoRespond(int success, CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArrP, XmlBlasterException *exception)

Definition at line 79 of file CallbackServerUnparsed.h.typedef void( * ) CallbackServerUnparsedLogging(void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char *location, const char *fmt,...)

Definition at line 95 of file CallbackServerUnparsed.h.typedef void( * ) CallbackServerUnparsedSendResponse(CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArr)

Definition at line 77 of file CallbackServerUnparsed.h.typedef void( * ) CallbackServerUnparsedSendXmlBlasterException(CallbackServerUnparsed *cb, void *socketDataHolder, XmlBlasterException *exception)

Definition at line 78 of file CallbackServerUnparsed.h.typedef void*(*) cbFp(void *)
Function pointer for pthread, the method to invoke on thread creation. 

Definition at line 187 of file CallbackServerUnparsed.h.typedef int(* ) InitCallbackServer(CallbackServerUnparsed *cb)

Definition at line 50 of file CallbackServerUnparsed.h.typedef int(* ) IsListening(CallbackServerUnparsed *cb)

Returns:
true if the socket is open and waits for callback messages 

Definition at line 55 of file CallbackServerUnparsed.h.typedef struct ListenLoopArgsStruct  ListenLoopArgs
Auxiliary struct for passing parameters to listening threads. 

typedef ResponseListener*( * ) RemoveResponseListener(CallbackServerUnparsed *cb, const char *requestId)

Definition at line 93 of file CallbackServerUnparsed.h.typedef void(* ) ResponseFp(MsgRequestInfo *msgRequestInfoP, void *socketDataHolder)

Definition at line 83 of file CallbackServerUnparsed.h.typedef struct ResponseListenerStruct  ResponseListener
typedef void(* ) ShutdownCallbackServerRaw(CallbackServerUnparsed *cb)

Definition at line 75 of file CallbackServerUnparsed.h.typedef void(*) UpdateCbFp(MsgUnitArr *msg, void *userData, XmlBlasterException *xmlBlasterException, void *socketDataHolder)
Here we asynchronously receive the callback from xmlBlaster. 

NOTE: After this call the memory of MsgUnitArr is freed immediately by CallbackServerUnparsed So you need to take a copy of all message members if needed out of the scope of this function.
Parameters:
msgUnitArr The messages from the server, use MgsUnit::responseQos to transport the return value 
userData An optional pointer from the client with client specific data which is delivered back 
xmlBlasterException This points on a valid XmlBlasterException struct, so you only need to fill errorCode with strcpy() and the returned pointer is ignored and the exception is thrown to xmlBlaster. 
socketDataHolder SocketDataHolder containing socket specific informations, please handle as readonly 
Returns:
Return true if everything is OK Return false if you want to throw an exception, please fill xmlBlasterException in such a case. If false and *xmlBlasterException.errorCode==0 we don't send a return message (useful for update dispatcher thread to do it later) 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.update.html 

Definition at line 73 of file CallbackServerUnparsed.h.typedef int(* ) UseThisSocket(CallbackServerUnparsed *cb, int socketToUse, int socketToUseUdp)
Use this function directly after creation of the callback server if you want to force to reuse the given socket for callbacks. 

Parameters:
socketToUse Usually pass -1 so that we establish a callback server, else pass an opened socket (e.g. from XmlBlasterConnectionUnparsed->socketToXmlBlaster) 
socketToUseUdp Usually pass -1 so that we establish a callback server, else pass an opened socket (e.g. from XmlBlasterConnectionUnparsed->socketToXmlBlaster) 
Returns:
true on success 

Definition at line 48 of file CallbackServerUnparsed.h.
Function Documentation
const char* callbackServerRawUsage ()
Help on configuration. 

Definition at line 758 of file CallbackServerUnparsed.c.
Referenced by xmlBlasterAccessUnparsedUsage().void freeCallbackServerUnparsed (CallbackServerUnparsed ** callbackData)
free() the CallbackServerUnparsed structure and sets *callbackData to 0 Call freeCallbackServerUnparsed(&cb); 

Definition at line 127 of file CallbackServerUnparsed.c.
References freeProperties(), CallbackServerUnparsedStruct::props, and shutdownCallbackServer().
Referenced by freeXmlBlasterAccessUnparsed(), getCallbackServerUnparsed(), and initialize().
Here is the call graph for this function:

IMAGE
CallbackServerUnparsed* getCallbackServerUnparsed (int argc, const char *const * argv, UpdateCbFp updateCb, void * userData)
Get a new instance of a callback server struct. 

This is usually the first call of a client, you need to call runCallbackServer() on the returned pointer to establish a listener. 
Parameters:
argc Number of command line arguments 
argv The command line arguments 
updateCb The function pointer on your update() function which handles the received messages Please read the documentation of UpdateCbFp above. 
userData An optional pointer from the client with client specific data which is delivered back with the updateCb() function 
Returns:
NULL if allocation or bootstrapping failed. If not NULL you need to free() it when you are done usually by calling freeXmlBlasterConnectionUnparsed(). 

Referenced by initialize().

socket/CallbackServerUnparsed.c File Reference
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <socket/xmlBlasterSocket.h>
#include <CallbackServerUnparsed.h>

Include dependency graph for CallbackServerUnparsed.c:

IMAGE

Functions
static int useThisSocket (CallbackServerUnparsed *cb, int socketToUse, int socketToUseUdp)
static int runCallbackServer (CallbackServerUnparsed *cb)
Open a socket, this method is usually called from the new thread (see pthread_create()) and only leaves when the connection is lost (on EOF), in this case implicit pthread_exit() is called. 

static int createCallbackServer (CallbackServerUnparsed *cb)
Is only called if we start a dedicated callback server (not tunneling through the connection socket). 

static int isListening (CallbackServerUnparsed *cb)
static int readMessage (CallbackServerUnparsed *cb, SocketDataHolder *socketDataHolder, XmlBlasterException *exception, int udp)
Parse the update message from xmlBlaster. 

static ssize_t writenPlain (void *userP, int fd, char *ptr, size_t nbytes)
Write uncompressed to socket (not thread safe). 

static ssize_t readnPlain (void *userP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Read data from socket, uncompress data if needed (not thread safe). 

static int addResponseListener (CallbackServerUnparsed *cb, MsgRequestInfo *msgRequestInfoP, ResponseFp responseEventFp)
static ResponseListener * removeResponseListener (CallbackServerUnparsed *cb, char *requestId)
static void voidSendResponse (CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArrP)
A helper to cast to SocketDataHolder. 

static void sendResponse (CallbackServerUnparsed *cb, SocketDataHolder *socketDataHolder, MsgUnitArr *msgUnitArr)
static void voidSendXmlBlasterException (CallbackServerUnparsed *cb, void *socketDataHolder, XmlBlasterException *exception)
static void sendXmlBlasterException (CallbackServerUnparsed *cb, SocketDataHolder *socketDataHolder, XmlBlasterException *exception)
static void voidSendResponseOrException (int success, CallbackServerUnparsed *cb, void *socketDataHolder, MsgUnitArr *msgUnitArrP, XmlBlasterException *exception)
A helper to cast to SocketDataHolder Frees msgUnitArrP. 

static void sendResponseOrException (int success, CallbackServerUnparsed *cb, SocketDataHolder *socketDataHolder, MsgUnitArr *msgUnitArrP, XmlBlasterException *exception)
Takes care of both successful responses as well as exceptions Frees msgUnitArrP. 

static void shutdownCallbackServer (CallbackServerUnparsed *cb)
Used internally only to close the socket, calling multiple times makes no harm. 

static void closeAcceptSocket (CallbackServerUnparsed *cb)
Force closing socket. 

CallbackServerUnparsed * getCallbackServerUnparsed (int argc, char **argv, UpdateCbFp updateCb, void *updateCbUserData)
See header for a description. 

void freeCallbackServerUnparsed (CallbackServerUnparsed **cb_)
free() the CallbackServerUnparsed structure and sets *callbackData to 0 Call freeCallbackServerUnparsed(&cb); 

static ResponseListener * getResponseListener (CallbackServerUnparsed *cb, char *requestId)
static void handleMessage (CallbackServerUnparsed *cb, SocketDataHolder *socketDataHolder, XmlBlasterException *xmlBlasterException, int success)
static int listenLoop (ListenLoopArgs *ls)
The run method of the two threads. 

char * callbackServerRawUsage ()
Help on configuration. 

Function Documentation
static int addResponseListener (CallbackServerUnparsed * cb, MsgRequestInfo * msgRequestInfoP, ResponseFp responseEventFp) [static]

Definition at line 154 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, MAX_RESPONSE_LISTENER_SIZE, ResponseListenerStruct::msgRequestInfoP, MsgRequestInfoStruct::requestIdStr, ResponseListenerStruct::responseEventFp, CallbackServerUnparsedStruct::responseListener, and XMLBLASTER_LOG_TRACE.
Referenced by getCallbackServerUnparsed().char* callbackServerRawUsage ()
Help on configuration. 

Definition at line 758 of file CallbackServerUnparsed.c.
Referenced by xmlBlasterAccessUnparsedUsage().static void closeAcceptSocket (CallbackServerUnparsed * cb) [static]
Force closing socket. 

Definition at line 700 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, closeSocket(), CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, and XMLBLASTER_LOG_TRACE.
Referenced by handleMessage(), and shutdownCallbackServer().
Here is the call graph for this function:

IMAGE
static int createCallbackServer (CallbackServerUnparsed * cb) [static]
Is only called if we start a dedicated callback server (not tunneling through the connection socket). 

Returns:
true The callback server is started, false on error 

Definition at line 443 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, EXCEPTIONSTRUCT_MESSAGE_LEN, gethostbyname_re(), CallbackServerUnparsedStruct::hostCB, CallbackServerUnparsedStruct::isShutdown, CallbackServerUnparsedStruct::listenSocket, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, MAX_ERRNO_LEN, CallbackServerUnparsedStruct::portCB, SNPRINTF, strcpyRealloc(), XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, XMLBLASTER_LOG_WARN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by runCallbackServer().
Here is the call graph for this function:

IMAGE
void freeCallbackServerUnparsed (CallbackServerUnparsed ** cb_)
free() the CallbackServerUnparsed structure and sets *callbackData to 0 Call freeCallbackServerUnparsed(&cb); 

Definition at line 127 of file CallbackServerUnparsed.c.
References freeProperties(), CallbackServerUnparsedStruct::props, and shutdownCallbackServer().
Referenced by freeXmlBlasterAccessUnparsed(), getCallbackServerUnparsed(), and initialize().
Here is the call graph for this function:

IMAGE
CallbackServerUnparsed* getCallbackServerUnparsed (int argc, char ** argv, UpdateCbFp updateCb, void * updateCbUserData)
See header for a description. 

Definition at line 55 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, addResponseListener(), CallbackServerUnparsedStruct::addResponseListener, createProperties(), DEFAULT_CALLBACK_SERVER_PORT, freeCallbackServerUnparsed(), PropertiesStruct::getInt, PropertiesStruct::getString, CallbackServerUnparsedStruct::hostCB, isListening(), CallbackServerUnparsedStruct::isListening, CallbackServerUnparsedStruct::isShutdown, CallbackServerUnparsedStruct::listenSocket, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, MAX_RESPONSE_LISTENER_SIZE, XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, parseLogLevel(), CallbackServerUnparsedStruct::portCB, CallbackServerUnparsedStruct::props, CallbackServerUnparsedStruct::readFromSocket, XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP, readnPlain(), removeResponseListener(), CallbackServerUnparsedStruct::removeResponseListener, CallbackServerUnparsedStruct::responseListener, CallbackServerUnparsedStruct::reusingConnectionSocket, runCallbackServer(), CallbackServerUnparsedStruct::runCallbackServer, CallbackServerUnparsedStruct::sendResponse, CallbackServerUnparsedStruct::sendResponseOrException, CallbackServerUnparsedStruct::sendXmlBlasterException, CallbackServerUnparsedStruct::shutdown, shutdownCallbackServer(), CallbackServerUnparsedStruct::socketUdp, CallbackServerUnparsedStruct::stopListenLoop, strcpyAlloc(), CallbackServerUnparsedStruct::updateCb, CallbackServerUnparsedStruct::updateCbUserData, XmlBlasterReadFromSocketFuncHolder::userP, XmlBlasterWriteToSocketFuncHolder::userP, useThisSocket(), CallbackServerUnparsedStruct::useThisSocket, voidSendResponse(), voidSendResponseOrException(), voidSendXmlBlasterException(), writenPlain(), CallbackServerUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, and xmlBlasterDefaultLogging().
Here is the call graph for this function:

IMAGE
static ResponseListener* getResponseListener (CallbackServerUnparsed * cb, char * requestId) [static]

Definition at line 173 of file CallbackServerUnparsed.c.
References MAX_RESPONSE_LISTENER_SIZE, ResponseListenerStruct::msgRequestInfoP, MsgRequestInfoStruct::requestIdStr, and CallbackServerUnparsedStruct::responseListener.static void handleMessage (CallbackServerUnparsed * cb, SocketDataHolder * socketDataHolder, XmlBlasterException * xmlBlasterException, int success) [static]

Definition at line 205 of file CallbackServerUnparsed.c.
References SocketDataHolder::blob, closeAcceptSocket(), encodeXmlBlasterException(), freeBlobHolderContent(), initializeXmlBlasterException(), CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, MAX_METHODNAME_LEN, MAX_REQUESTID_LEN, MAX_RESPONSE_LISTENER_SIZE, SocketDataHolder::methodName, MSG_TYPE_EXCEPTION, ResponseListenerStruct::msgRequestInfoP, SocketDataHolder::requestId, CallbackServerUnparsedStruct::responseListener, CallbackServerUnparsedStruct::reusingConnectionSocket, SNPRINTF, strncpy0(), SocketDataHolder::type, XMLBLASTER_LOG_TRACE, XMLBLASTER_LOG_WARN, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by listenLoop().
Here is the call graph for this function:

IMAGE
static int isListening (CallbackServerUnparsed * cb) [static]

Definition at line 537 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::listenSocket.
Referenced by getCallbackServerUnparsed(), and shutdownCallbackServer().static int listenLoop (ListenLoopArgs * ls) [static]
The run method of the two threads. 

Definition at line 327 of file CallbackServerUnparsed.c.
References ListenLoopArgsStruct::cb, handleMessage(), CallbackServerUnparsedStruct::listenMutex, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, readMessage(), CallbackServerUnparsedStruct::socketUdp, CallbackServerUnparsedStruct::stopListenLoop, ListenLoopArgsStruct::udp, XMLBLASTER_LOG_ERROR, and XMLBLASTER_LOG_TRACE.
Referenced by runCallbackServer().
Here is the call graph for this function:

IMAGE
static int readMessage (CallbackServerUnparsed * cb, SocketDataHolder * socketDataHolder, XmlBlasterException * exception, int udp) [static]
Parse the update message from xmlBlaster. 

This method blocks until data arrives.  The socketDataHolder holds all informations about the returned data from xmlBlaster, on error the exception struct is filled.
Parameters:
cb The 'this' pointer 
socketDataHolder You need to free(socketDataHolder->data) if return is 'true'. 
exception Contains the exception thrown (on error only) 
udp If UDP to use 
Returns:
true if OK or on exception, false on EOF 

Definition at line 559 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, CallbackServerUnparsedStruct::logLevel, parseSocketData(), CallbackServerUnparsedStruct::readFromSocket, CallbackServerUnparsedStruct::socketUdp, CallbackServerUnparsedStruct::stopListenLoop, and XMLBLASTER_LOG_DUMP.
Referenced by listenLoop().
Here is the call graph for this function:

IMAGE
static ssize_t readnPlain (void * cb, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2) [static]
Read data from socket, uncompress data if needed (not thread safe). 

Definition at line 149 of file CallbackServerUnparsed.c.
References readn().
Referenced by getCallbackServerUnparsed(), initConnection(), and initialize().
Here is the call graph for this function:

IMAGE
static ResponseListener * removeResponseListener (CallbackServerUnparsed * cb, char * requestId) [static]

Definition at line 190 of file CallbackServerUnparsed.c.
References MAX_RESPONSE_LISTENER_SIZE, ResponseListenerStruct::msgRequestInfoP, MsgRequestInfoStruct::requestIdStr, and CallbackServerUnparsedStruct::responseListener.
Referenced by getCallbackServerUnparsed().static int runCallbackServer (CallbackServerUnparsed * cb) [static]
Open a socket, this method is usually called from the new thread (see pthread_create()) and only leaves when the connection is lost (on EOF), in this case implicit pthread_exit() is called. 

xmlBlaster will connect and receive callback messages. 
Returns:
0 on success, 1 on error. The return value is the exit value returned by pthread_join() 

Definition at line 377 of file CallbackServerUnparsed.c.
References ListenLoopArgsStruct::cb, createCallbackServer(), CallbackServerUnparsedStruct::isShutdown, listenLoop(), CallbackServerUnparsedStruct::listenMutex, CallbackServerUnparsedStruct::listenSocket, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, CallbackServerUnparsedStruct::socketUdp, ListenLoopArgsStruct::udp, XMLBLASTER_LOG_ERROR, and XMLBLASTER_LOG_TRACE.
Referenced by getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
static void sendResponse (CallbackServerUnparsed * cb, SocketDataHolder * socketDataHolder, MsgUnitArr * msgUnitArr) [static]

Definition at line 571 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, BlobHolder::data, BlobHolder::dataLen, encodeMsgUnit(), encodeSocketMessage(), MsgUnitStructArr::len, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, SocketDataHolder::methodName, MSG_TYPE_RESPONSE, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, SocketDataHolder::requestId, MsgUnit::responseQos, SocketDataHolder::secretSessionId, strcpyAlloc(), CallbackServerUnparsedStruct::updateCbUserData, CallbackServerUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, XMLBLASTER_LOG_DUMP, and XMLBLASTER_LOG_TRACE.
Referenced by sendResponseOrException(), and voidSendResponse().
Here is the call graph for this function:

IMAGE
static void sendResponseOrException (int success, CallbackServerUnparsed * cb, SocketDataHolder * socketDataHolder, MsgUnitArr * msgUnitArrP, XmlBlasterException * exception) [static]
Takes care of both successful responses as well as exceptions Frees msgUnitArrP. 

Definition at line 672 of file CallbackServerUnparsed.c.
References ExceptionStruct::errorCode, freeMsgUnitArr(), CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, ExceptionStruct::message, SocketDataHolder::methodName, SocketDataHolder::requestId, sendResponse(), sendXmlBlasterException(), XMLBLASTER_LOG_TRACE, and XMLBLASTER_UPDATE_ONEWAY.
Referenced by voidSendResponseOrException().
Here is the call graph for this function:

IMAGE
static void sendXmlBlasterException (CallbackServerUnparsed * cb, SocketDataHolder * socketDataHolder, XmlBlasterException * exception) [static]

Definition at line 626 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, MsgUnit::content, MsgUnit::contentLen, BlobHolder::data, BlobHolder::dataLen, encodeMsgUnit(), encodeSocketMessage(), ExceptionStruct::errorCode, CallbackServerUnparsedStruct::logLevel, ExceptionStruct::message, SocketDataHolder::methodName, MsgUnit::qos, SocketDataHolder::requestId, SocketDataHolder::secretSessionId, CallbackServerUnparsedStruct::updateCbUserData, CallbackServerUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, and XMLBLASTER_LOG_DUMP.
Referenced by sendResponseOrException(), and voidSendXmlBlasterException().
Here is the call graph for this function:

IMAGE
static void shutdownCallbackServer (CallbackServerUnparsed * cb) [static]
Used internally only to close the socket, calling multiple times makes no harm. 

Definition at line 717 of file CallbackServerUnparsed.c.
References closeAcceptSocket(), closeSocket(), CallbackServerUnparsedStruct::hostCB, isListening(), CallbackServerUnparsedStruct::listenSocket, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, XmlBlasterReadFromSocketFuncHolder::numReadFuncP, CallbackServerUnparsedStruct::readFromSocket, CallbackServerUnparsedStruct::reusingConnectionSocket, CallbackServerUnparsedStruct::stopListenLoop, and XMLBLASTER_LOG_TRACE.
Referenced by freeCallbackServerUnparsed(), and getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
int useThisSocket (CallbackServerUnparsed * cb, int socketToUse, int socketToUseUdp) [static]

Definition at line 103 of file CallbackServerUnparsed.c.
References CallbackServerUnparsedStruct::acceptSocket, CallbackServerUnparsedStruct::hostCB, CallbackServerUnparsedStruct::listenSocket, CallbackServerUnparsedStruct::log, CallbackServerUnparsedStruct::logLevel, CallbackServerUnparsedStruct::logUserP, CallbackServerUnparsedStruct::portCB, CallbackServerUnparsedStruct::reusingConnectionSocket, CallbackServerUnparsedStruct::socketUdp, strcpyRealloc(), XMLBLASTER_LOG_INFO, and XMLBLASTER_LOG_WARN.
Referenced by getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
static void voidSendResponse (CallbackServerUnparsed * cb, void * socketDataHolder, MsgUnitArr * msgUnitArr) [static]
A helper to cast to SocketDataHolder. 

Definition at line 566 of file CallbackServerUnparsed.c.
References sendResponse().
Referenced by getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
static void voidSendResponseOrException (int success, CallbackServerUnparsed * cb, void * socketDataHolder, MsgUnitArr * msgUnitArrP, XmlBlasterException * exception) [static]
A helper to cast to SocketDataHolder Frees msgUnitArrP. 

Definition at line 663 of file CallbackServerUnparsed.c.
References sendResponseOrException().
Referenced by getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
static void voidSendXmlBlasterException (CallbackServerUnparsed * cb, void * socketDataHolder, XmlBlasterException * exception) [static]

Definition at line 621 of file CallbackServerUnparsed.c.
References sendXmlBlasterException().
Referenced by getCallbackServerUnparsed().
Here is the call graph for this function:

IMAGE
static ssize_t writenPlain (void * cb, int fd, char * ptr, size_t nbytes) [static]
Write uncompressed to socket (not thread safe). 

Definition at line 141 of file CallbackServerUnparsed.c.
References writen().
Referenced by getCallbackServerUnparsed(), initConnection(), and initialize().
Here is the call graph for this function:

IMAGE

socket/XmlBlasterAccessUnparsed.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <socket/xmlBlasterSocket.h>
#include <socket/xmlBlasterZlib.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for XmlBlasterAccessUnparsed.c:

IMAGE

Data Structures
struct UpdateContainer
Little helper to collect args for the new created thread. 

Functions
static int initialize (XmlBlasterAccessUnparsed *xa, UpdateFp update, XmlBlasterException *exception)
static char * xmlBlasterConnect (XmlBlasterAccessUnparsed *xa, char *qos, UpdateFp update, XmlBlasterException *exception)
static int xmlBlasterDisconnect (XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterException *exception)
static char * xmlBlasterPublish (XmlBlasterAccessUnparsed *xa, MsgUnit *msgUnit, XmlBlasterException *exception)
Publish a message to the server. 

static QosArr * xmlBlasterPublishArr (XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
Publish a message array in a bulk to the server. 

static void xmlBlasterPublishOneway (XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
Publish a message array in a bulk to the server, we don't receive an ACK. 

static char * xmlBlasterSubscribe (XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterException *exception)
Subscribe a message. 

static QosArr * xmlBlasterUnSubscribe (XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterException *exception)
UnSubscribe a message from the server. 

static QosArr * xmlBlasterErase (XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterException *exception)
Erase a message from the server. 

static MsgUnitArr * xmlBlasterGet (XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterException *exception)
Get a message. 

static char * xmlBlasterPing (XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterException *exception)
Ping the server. 

static int isConnected (XmlBlasterAccessUnparsed *xa)
static void responseEvent (MsgRequestInfo *msgRequestInfoP, void *socketDataHolder)
This function is called by the callback server when a response message arrived (after we send a request). 

static MsgRequestInfo * preSendEvent (MsgRequestInfo *msgRequestInfoP, XmlBlasterException *exception)
Callback from XmlBlasterConnectionUnparsed just before a message is sent, the msgRequestInfo contains the requestId used. 

static MsgRequestInfo * postSendEvent (MsgRequestInfo *msgRequestInfoP, XmlBlasterException *exception)
Callback function (wait for response) called directly after a message is sent. 

static int checkArgs (XmlBlasterAccessUnparsed *xa, char *methodName, int checkIsConnected, XmlBlasterException *exception)
static void interceptUpdate (MsgUnitArr *msgUnitArrP, void *userData, XmlBlasterException *exception, void *socketDataHolder)
Here we receive the callback messages from xmlBlaster, create a thread and dispatch it to the clients update. 

static int mutexUnlock (MsgRequestInfo *msgRequestInfoP, XmlBlasterException *exception)
Free lock. 

static ssize_t writenPlain (void *userP, int fd, char *ptr, size_t nbytes)
Write uncompressed to socket (thread safe). 

static ssize_t writenCompressed (void *userP, int fd, char *ptr, size_t nbytes)
Compress data and send to socket. 

static ssize_t readnPlain (void *userP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Read uncompressed to socket (thread safe). 

static ssize_t readnCompressed (void *userP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Read data from socket, uncompress it if necessary. 

XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsed (int argc, char **argv)
void freeXmlBlasterAccessUnparsed (XmlBlasterAccessUnparsed *xa)
Free your instance after accessing xmlBlaster. 

char * xmlBlasterAccessUnparsedUsage (char *usage)
Help usage. 

static int runUpdate (UpdateContainer *container)
Run by the new created thread, calls the clients update method. 

Function Documentation
static int checkArgs (XmlBlasterAccessUnparsed * xa, char * methodName, int checkIsConnected, XmlBlasterException * exception) [static]

Definition at line 820 of file XmlBlasterAccessUnparsed.c.
References ExceptionStruct::errorCode, getStackTrace(), initializeXmlBlasterException(), XmlBlasterAccessUnparsed::isConnected, XmlBlasterAccessUnparsed::isShutdown, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, SNPRINTF, strncpy0(), XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_WARN, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
void freeXmlBlasterAccessUnparsed (XmlBlasterAccessUnparsed * xa)
Free your instance after accessing xmlBlaster. 

Definition at line 136 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::callbackThreadId, XmlBlasterAccessUnparsed::connectionP, freeCallbackServerUnparsed(), freeProperties(), freeXmlBlasterConnectionUnparsed(), get_pthread_id(), PropertiesStruct::getBool, getStackTrace(), CallbackServerUnparsedStruct::isShutdown, XmlBlasterAccessUnparsed::isShutdown, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::props, XmlBlasterAccessUnparsed::readnMutex, XmlBlasterConnectionUnparsedStruct::shutdown, CallbackServerUnparsedStruct::shutdown, sleepMillis(), XmlBlasterAccessUnparsed::threadCounter, XmlBlasterAccessUnparsed::writenMutex, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, and XMLBLASTER_LOG_WARN.
Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), main(), and myUpdate().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsed (int argc, char ** argv)

Definition at line 74 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, XmlBlasterAccessUnparsed::callbackMultiThreaded, XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::callbackThreadId, XmlBlasterAccessUnparsed::clientsUpdateFp, XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::connectionP, createProperties(), XmlBlasterAccessUnparsed::disconnect, XmlBlasterAccessUnparsed::erase, freeXmlBlasterAccessUnparsed(), XmlBlasterAccessUnparsed::get, PropertiesStruct::getBool, getLogLevelStr(), PropertiesStruct::getLong, PropertiesStruct::getString, initialize(), XmlBlasterAccessUnparsed::initialize, isConnected(), XmlBlasterAccessUnparsed::isConnected, XmlBlasterAccessUnparsed::isInitialized, XmlBlasterAccessUnparsed::isShutdown, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::lowLevelAutoAck, parseLogLevel(), XmlBlasterAccessUnparsed::ping, XmlBlasterAccessUnparsed::props, XmlBlasterAccessUnparsed::publish, XmlBlasterAccessUnparsed::publishArr, XmlBlasterAccessUnparsed::publishOneway, XmlBlasterAccessUnparsed::readnMutex, XmlBlasterAccessUnparsed::responseTimeout, XmlBlasterAccessUnparsed::subscribe, XmlBlasterAccessUnparsed::threadCounter, XmlBlasterAccessUnparsed::unSubscribe, XmlBlasterAccessUnparsed::userFp, XmlBlasterAccessUnparsed::userObject, XmlBlasterAccessUnparsed::writenMutex, XMLBLASTER_LOG_DUMP, xmlBlasterConnect(), xmlBlasterDefaultLogging(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
Here is the call graph for this function:

IMAGE
static int initialize (XmlBlasterAccessUnparsed * xa, UpdateFp update, XmlBlasterException * exception) [static]

Definition at line 257 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::callbackThreadId, checkArgs(), XmlBlasterAccessUnparsed::clientsUpdateFp, XmlBlasterAccessUnparsed::connectionP, ExceptionStruct::errorCode, freeCallbackServerUnparsed(), freeXmlBlasterConnectionUnparsed(), getCallbackServerUnparsed(), PropertiesStruct::getString, getXmlBlasterConnectionUnparsed(), CallbackServerUnparsedStruct::hostCB, XmlBlasterConnectionUnparsedStruct::initConnection, interceptUpdate(), XmlBlasterAccessUnparsed::isInitialized, CallbackServerUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, CallbackServerUnparsedStruct::logUserP, XmlBlasterConnectionUnparsedStruct::logUserP, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, CallbackServerUnparsedStruct::portCB, postSendEvent(), XmlBlasterConnectionUnparsedStruct::postSendEvent, XmlBlasterConnectionUnparsedStruct::postSendEvent_userP, preSendEvent(), XmlBlasterConnectionUnparsedStruct::preSendEvent, XmlBlasterConnectionUnparsedStruct::preSendEvent_userP, XmlBlasterAccessUnparsed::props, CallbackServerUnparsedStruct::readFromSocket, XmlBlasterConnectionUnparsedStruct::readFromSocket, XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP, readnCompressed(), readnPlain(), CallbackServerUnparsedStruct::runCallbackServer, SNPRINTF, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp, strncpy0(), XmlBlasterReadFromSocketFuncHolder::userP, XmlBlasterWriteToSocketFuncHolder::userP, CallbackServerUnparsedStruct::useThisSocket, writenCompressed(), writenPlain(), CallbackServerUnparsedStruct::writeToSocket, XmlBlasterConnectionUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by getXmlBlasterAccessUnparsed(), and xmlBlasterConnect().
Here is the call graph for this function:

IMAGE
static void interceptUpdate (MsgUnitArr * msgUnitArrP, void * userData, XmlBlasterException * exception, void * socketDataHolder) [static]
Here we receive the callback messages from xmlBlaster, create a thread and dispatch it to the clients update. 

See also:
UpdateFp in CallbackServerUnparsed.h 

Definition at line 903 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::callbackMultiThreaded, XmlBlasterAccessUnparsed::clientsUpdateFp, ExceptionStruct::errorCode, UpdateContainer::exception, get_pthread_id(), MsgUnit::key, MsgUnitStructArr::len, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::lowLevelAutoAck, ExceptionStruct::message, MsgUnitStructArr::msgUnitArr, UpdateContainer::msgUnitArrP, MsgUnit::responseQos, runUpdate(), CallbackServerUnparsedStruct::sendResponseOrException, SNPRINTF, UpdateContainer::socketDataHolder, strcpyAlloc(), strncpy0(), XmlBlasterAccessUnparsed::threadCounter, CallbackServerUnparsedStruct::updateCbUserData, UpdateContainer::userData, UpdateContainer::xa, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by initialize(), xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEInitialize(), xmlBlasterUnmanagedConnect(), and xmlBlasterUnmanagedInitialize().
Here is the call graph for this function:

IMAGE
static int isConnected (XmlBlasterAccessUnparsed * xa) [static]

Definition at line 378 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::connectionP, XmlBlasterConnectionUnparsedStruct::isConnected, and XmlBlasterAccessUnparsed::isShutdown.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().static int mutexUnlock (MsgRequestInfo * msgRequestInfoP, XmlBlasterException * exception) [static]
Free lock. 

Parameters:
msgRequestInfoP Transporting data 
exception The exception struct, can be null 
Returns:
false on error, the exception struct is filled in this case and the lock is not released 

Definition at line 565 of file XmlBlasterAccessUnparsed.c.
References ExceptionStruct::errorCode, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, MsgRequestInfoStruct::methodName, MsgRequestInfoStruct::requestIdStr, MsgRequestInfoStruct::responseMutex, MsgRequestInfoStruct::responseMutexIsLocked, SNPRINTF, strncpy0(), MsgRequestInfoStruct::xa, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by postSendEvent().
Here is the call graph for this function:

IMAGE
static MsgRequestInfo * postSendEvent (MsgRequestInfo * msgRequestInfoP, XmlBlasterException * exception) [static]
Callback function (wait for response) called directly after a message is sent. 

Parameters:
msgRequestInfoP Contains some informations about the request, may not be NULL 
exception May not be NULL 
Returns:
The returned string from a request is written into msgRequestInfoP->data, the caller needs to free() it. 

Definition at line 480 of file XmlBlasterAccessUnparsed.c.
References MsgRequestInfoStruct::blob, XmlBlasterAccessUnparsed::callbackP, convertToXmlBlasterException(), BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), getAbsoluteTime(), XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, MsgRequestInfoStruct::methodName, MSG_TYPE_EXCEPTION, mutexUnlock(), CallbackServerUnparsedStruct::removeResponseListener, MsgRequestInfoStruct::requestIdStr, MsgRequestInfoStruct::responseBlob, MsgRequestInfoStruct::responseCond, MsgRequestInfoStruct::responseMutex, XmlBlasterAccessUnparsed::responseTimeout, MsgRequestInfoStruct::responseType, MsgRequestInfoStruct::rollback, SNPRINTF, strncpy0(), MsgRequestInfoStruct::xa, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by initialize().
Here is the call graph for this function:

IMAGE
static MsgRequestInfo * preSendEvent (MsgRequestInfo * msgRequestInfoP, XmlBlasterException * exception) [static]
Callback from XmlBlasterConnectionUnparsed just before a message is sent, the msgRequestInfo contains the requestId used. 

This is the clients calling thread. 
Parameters:
msgRequestInfoP Contains some informations about the request, may not be NULL 
exception May not be NULL 
Returns:
The same (or a manipulated/encrypted) msgRequestInfo, if NULL the exception is filled. If msgRequestInfoP->blob.data was changed and malloc()'d by you, the caller will free() it. If you return NULL you need to call removeResponseListener() to avoid a memory leak. 

Definition at line 396 of file XmlBlasterAccessUnparsed.c.
References CallbackServerUnparsedStruct::addResponseListener, XmlBlasterAccessUnparsed::callbackP, BlobHolder::dataLen, ExceptionStruct::errorCode, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, MsgRequestInfoStruct::methodName, MSG_TYPE_INVOKE, MsgRequestInfoStruct::requestIdStr, MsgRequestInfoStruct::responseBlob, responseEvent(), MsgRequestInfoStruct::responseMutex, MsgRequestInfoStruct::responseMutexIsLocked, SNPRINTF, strncpy0(), MsgRequestInfoStruct::xa, xbl_isOneway(), XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by initialize().
Here is the call graph for this function:

IMAGE
static ssize_t readnCompressed (void * userP, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2) [static]
Read data from socket, uncompress it if necessary. 

Definition at line 1083 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::connectionP, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::readnMutex, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_TRACE, xmlBlaster_readnCompressed(), and XmlBlasterConnectionUnparsedStruct::zlibReadBuf.
Referenced by initConnection(), and initialize().
Here is the call graph for this function:

IMAGE
static ssize_t readnPlain (void * userP, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2) [static]
Read uncompressed to socket (thread safe). 

Definition at line 1063 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, readn(), XmlBlasterAccessUnparsed::readnMutex, and XMLBLASTER_LOG_ERROR.
Here is the call graph for this function:

IMAGE
static void responseEvent (MsgRequestInfo * msgRequestInfoP, void * socketDataHolder) [static]
This function is called by the callback server when a response message arrived (after we send a request). 

The xa->responseBlob->data is malloc()'d with the response string, you need to free it. This method is executed by the callback server thread. 
Parameters:
msgRequestInfoP May not be NULL 
socketDataHolder is on the stack and does not need to be freed, the 'data' member is malloc()'d and must be freed by the caller. 

Definition at line 443 of file XmlBlasterAccessUnparsed.c.
References SocketDataHolder::blob, blobcpyAlloc(), BlobHolder::data, BlobHolder::dataLen, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, SocketDataHolder::requestId, MsgRequestInfoStruct::responseBlob, MsgRequestInfoStruct::responseCond, MsgRequestInfoStruct::responseMutex, MsgRequestInfoStruct::responseType, SocketDataHolder::type, MsgRequestInfoStruct::xa, XMLBLASTER_LOG_ERROR, and XMLBLASTER_LOG_TRACE.
Referenced by preSendEvent().
Here is the call graph for this function:

IMAGE
static int runUpdate (UpdateContainer * container) [static]
Run by the new created thread, calls the clients update method. 

Leaving this pthread start routine does an implicit pthread_exit(). 
Parameters:
container Holding all necessary informations, we free it when we are done 
Returns:
0 on success, 1 on error. The return value is the exit value returned by pthread_join() 

Definition at line 870 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::clientsUpdateFp, UpdateContainer::exception, get_pthread_id(), XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::lowLevelAutoAck, UpdateContainer::msgUnitArrP, CallbackServerUnparsedStruct::sendResponseOrException, UpdateContainer::socketDataHolder, XmlBlasterAccessUnparsed::threadCounter, UpdateContainer::userData, UpdateContainer::xa, and XMLBLASTER_LOG_TRACE.
Referenced by interceptUpdate().
Here is the call graph for this function:

IMAGE
static ssize_t writenCompressed (void * xa, int fd, char * ptr, size_t nbytes) [static]
Compress data and send to socket. 

Definition at line 1039 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::connectionP, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::writenMutex, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_TRACE, xmlBlaster_writenCompressed(), and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Referenced by initConnection(), and initialize().
Here is the call graph for this function:

IMAGE
static ssize_t writenPlain (void * xa, int fd, char * ptr, size_t nbytes) [static]
Write uncompressed to socket (thread safe). 

Definition at line 1013 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, writen(), XmlBlasterAccessUnparsed::writenMutex, and XMLBLASTER_LOG_ERROR.
Here is the call graph for this function:

IMAGE
char* xmlBlasterAccessUnparsedUsage (char * usage)
Help usage. 

Parameters:
usage Please pass a string with at least XMLBLASTER_MAX_USAGE_LEN chars allocated (or on stack) 
Returns:
Your usage pointer filled with informations 

Definition at line 605 of file XmlBlasterAccessUnparsed.c.
References callbackServerRawUsage(), SNPRINTF, XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterConnectionUnparsedUsage().
Referenced by main(), xmlBlasterUnmanagedCEUsage(), and xmlBlasterUnmanagedUsage().
Here is the call graph for this function:

IMAGE
static char * xmlBlasterConnect (XmlBlasterAccessUnparsed * xa, char * qos, UpdateFp update, XmlBlasterException * exception) [static]

Definition at line 619 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::callbackP, checkArgs(), XmlBlasterConnectionUnparsedStruct::connect, XmlBlasterAccessUnparsed::connectionP, ExceptionStruct::errorCode, CallbackServerUnparsedStruct::hostCB, initialize(), XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, CallbackServerUnparsedStruct::portCB, XmlBlasterConnectionUnparsedStruct::secretSessionId, SNPRINTF, snprintf0(), strcpyAlloc(), strncat0(), strncpy0(), XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static int xmlBlasterDisconnect (XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterException * exception) [static]

Definition at line 697 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::disconnect.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterErase (XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterException * exception) [static]
Erase a message from the server. 

Returns:
A struct holding the raw QoS XML strings returned from xmlBlaster, only NULL if an exception is thrown. You need to freeQosArr() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.erase.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 781 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::erase.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static MsgUnitArr * xmlBlasterGet (XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterException * exception) [static]
Get a message. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.get.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
NULL on error, please check exception in such a case 

Definition at line 812 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::get.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static char * xmlBlasterPing (XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterException * exception) [static]
Ping the server. 

Parameters:
xa The 'this' pointer 
qos The QoS or 0 
exception *errorCode!=0 on failure 
Returns:
The ping return QoS raw xml string, you need to free() it or 0 on failure (in which case *exception.errorCode!=0) 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 798 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::ping.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static char * xmlBlasterPublish (XmlBlasterAccessUnparsed * xa, MsgUnit * msgUnit, XmlBlasterException * exception) [static]
Publish a message to the server. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
XmlBlasterConnectionUnparsed::publish() for a function documentation 

Definition at line 711 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::publish.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterPublishArr (XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterException * exception) [static]
Publish a message array in a bulk to the server. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
XmlBlasterConnectionUnparsed::publishArr() for a function documentation 

Definition at line 725 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::publishArr.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static void xmlBlasterPublishOneway (XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterException * exception) [static]
Publish a message array in a bulk to the server, we don't receive an ACK. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
XmlBlasterConnectionUnparsed::publishOneway() for a function documentation 

Definition at line 739 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::publishOneway.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static char * xmlBlasterSubscribe (XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterException * exception) [static]
Subscribe a message. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.subscribe.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 750 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::subscribe.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterUnSubscribe (XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterException * exception) [static]
UnSubscribe a message from the server. 

Returns:
The raw QoS XML strings returned from xmlBlaster, only NULL if an exception is thrown You need to free it with freeQosArr() after usage 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.unSubscribe.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 765 of file XmlBlasterAccessUnparsed.c.
References checkArgs(), XmlBlasterAccessUnparsed::connectionP, and XmlBlasterConnectionUnparsedStruct::unSubscribe.
Referenced by getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE

socket/XmlBlasterConnectionUnparsed.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <socket/xmlBlasterSocket.h>
#include <socket/xmlBlasterZlib.h>
#include <XmlBlasterConnectionUnparsed.h>

Include dependency graph for XmlBlasterConnectionUnparsed.c:

IMAGE

Defines
#define SOCKET_TCP  false
Functions
static int initConnection (XmlBlasterConnectionUnparsed *xb, XmlBlasterException *exception)
Connects on TCP/IP level to xmlBlaster. 

static int xmlBlasterInitQueue (XmlBlasterConnectionUnparsed *xb, QueueProperties *queueProperties, XmlBlasterException *exception)
Set the queue properties. 

static int getResponse (XmlBlasterConnectionUnparsed *xb, SocketDataHolder *responseSocketDataHolder, XmlBlasterException *exception, int udp)
Parse the returned message from xmlBlaster. 

static char * xmlBlasterConnect (XmlBlasterConnectionUnparsed *xb, char *qos, XmlBlasterException *exception)
Connect to the server. 

static int xmlBlasterDisconnect (XmlBlasterConnectionUnparsed *xb, char *qos, XmlBlasterException *exception)
Disconnect from server. 

static char * xmlBlasterPublish (XmlBlasterConnectionUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception)
Publish a message to the server. 

static QosArr * xmlBlasterPublishArr (XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
Publish a message array in a bulk to the server. 

static void xmlBlasterPublishOneway (XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
Publish oneway a message array in a bulk to the server without receiving an ACK. 

static char * xmlBlasterSubscribe (XmlBlasterConnectionUnparsed *xb, char *key, char *qos, XmlBlasterException *exception)
Subscribe a message. 

static QosArr * xmlBlasterUnSubscribe (XmlBlasterConnectionUnparsed *xb, char *key, char *qos, XmlBlasterException *exception)
UnSubscribe a message from the server. 

static QosArr * xmlBlasterErase (XmlBlasterConnectionUnparsed *xb, char *key, char *qos, XmlBlasterException *exception)
Erase a message from the server. 

static MsgUnitArr * xmlBlasterGet (XmlBlasterConnectionUnparsed *xb, char *key, char *qos, XmlBlasterException *exception)
Get a message. 

static char * xmlBlasterPing (XmlBlasterConnectionUnparsed *xb, char *qos, XmlBlasterException *exception)
Ping the server. 

static int isConnected (XmlBlasterConnectionUnparsed *xb)
static void xmlBlasterConnectionShutdown (XmlBlasterConnectionUnparsed *xb)
Used internally only, does no disconnect, only cleanup of socket. 

static ssize_t writenPlain (void *userP, int fd, char *ptr, size_t nbytes)
Write uncompressed to socket (not thread safe). 

static ssize_t writenCompressed (void *userP, int fd, char *ptr, size_t nbytes)
Compress data and send to socket. 

static ssize_t readnPlain (void *userP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Write uncompressed to socket (not thread safe). 

static ssize_t readnCompressed (void *userP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Compress data and send to socket. 

static int checkArgs (XmlBlasterConnectionUnparsed *xb, char *methodName, int checkIsConnected, XmlBlasterException *exception)
Checks the given arguments to be valid. 

XmlBlasterConnectionUnparsed * getXmlBlasterConnectionUnparsed (int argc, char **argv)
Create a new instance to handle a synchronous connection to the server. 

void freeXmlBlasterConnectionUnparsed (XmlBlasterConnectionUnparsed **xb_)
Free your instance after accessing xmlBlaster. 

char * xmlBlasterConnectionUnparsedUsage ()
Help usage. 

static int sendData (XmlBlasterConnectionUnparsed *xb, char *methodName, enum XMLBLASTER_MSG_TYPE_ENUM msgType, char *data_, size_t dataLen_, SocketDataHolder *responseSocketDataHolder, XmlBlasterException *exception, int udp)
Send a message over the socket to xmlBlaster. 

Define Documentation
#define SOCKET_TCP  false

Definition at line 29 of file XmlBlasterConnectionUnparsed.c.
Referenced by xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
Function Documentation
static int checkArgs (XmlBlasterConnectionUnparsed * xb, char * methodName, int checkIsConnected, XmlBlasterException * exception) [static]
Checks the given arguments to be valid. 

Parameters:
methodName For logging 
checkIsConnected If true does check the connection state as well 
Returns:
false if the parameters are not usable, in this case 'exception' is filled with detail informations 

Definition at line 1376 of file XmlBlasterConnectionUnparsed.c.
References ExceptionStruct::errorCode, getStackTrace(), XmlBlasterConnectionUnparsedStruct::isConnected, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, ExceptionStruct::message, SNPRINTF, strncpy0(), XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_WARN, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
void freeXmlBlasterConnectionUnparsed (XmlBlasterConnectionUnparsed ** xmlBlasterAccess)
Free your instance after accessing xmlBlaster. 

After freeing *xmlBlasterAccess is set to null Call example: freeXmlBlasterConnectionUnparsed(&xa->connectionP); 

Definition at line 105 of file XmlBlasterConnectionUnparsed.c.
References freeProperties(), XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, XmlBlasterConnectionUnparsedStruct::props, xmlBlaster_endZlibReader(), xmlBlaster_endZlibWriter(), XMLBLASTER_LOG_TRACE, xmlBlasterConnectionShutdown(), XmlBlasterConnectionUnparsedStruct::zlibReadBuf, and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterConnectionUnparsed(), and initialize().
Here is the call graph for this function:

IMAGE
static int getResponse (XmlBlasterConnectionUnparsed * xb, SocketDataHolder * responseSocketDataHolder, XmlBlasterException * exception, int udp) [static]
Parse the returned message from xmlBlaster. 

This method blocks until data arrives. 
 The responseSocketDataHolder holds all informations about the returned data from xmlBlaster, on error the exception struct is filled.
Parameters:
responseSocketDataHolder You need to free(responseSocketDataHolder->data) if return is 'true'. 
exception Contains the exception thrown (on error only *exception->errorCode!=0) 
Returns:
true if OK or on exception, false on EOF 

Definition at line 782 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::logLevel, parseSocketData(), XmlBlasterConnectionUnparsedStruct::readFromSocket, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, and XMLBLASTER_LOG_DUMP.
Referenced by sendData().
Here is the call graph for this function:

IMAGE
XmlBlasterConnectionUnparsed* getXmlBlasterConnectionUnparsed (int argc, char ** argv)
Create a new instance to handle a synchronous connection to the server. 

This is usually the first call of a client. 
Returns:
NULL if bootstrapping failed. If not NULL you need to free() it when you are done usually by calling freeXmlBlasterConnectionUnparsed(). 

Definition at line 58 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::argc, XmlBlasterConnectionUnparsedStruct::argv, XmlBlasterConnectionUnparsedStruct::connect, createProperties(), XmlBlasterConnectionUnparsedStruct::disconnect, XmlBlasterConnectionUnparsedStruct::erase, freeXmlBlasterConnectionUnparsed(), XmlBlasterConnectionUnparsedStruct::get, PropertiesStruct::getString, initConnection(), XmlBlasterConnectionUnparsedStruct::initConnection, XmlBlasterConnectionUnparsedStruct::initQueue, isConnected(), XmlBlasterConnectionUnparsedStruct::isConnected, XmlBlasterConnectionUnparsedStruct::isInitialized, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, parseLogLevel(), XmlBlasterConnectionUnparsedStruct::ping, XmlBlasterConnectionUnparsedStruct::postSendEvent, XmlBlasterConnectionUnparsedStruct::postSendEvent_userP, XmlBlasterConnectionUnparsedStruct::preSendEvent, XmlBlasterConnectionUnparsedStruct::preSendEvent_userP, XmlBlasterConnectionUnparsedStruct::props, XmlBlasterConnectionUnparsedStruct::publish, XmlBlasterConnectionUnparsedStruct::publishArr, XmlBlasterConnectionUnparsedStruct::publishOneway, XmlBlasterConnectionUnparsedStruct::queueP, XmlBlasterConnectionUnparsedStruct::readFromSocket, XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP, XmlBlasterConnectionUnparsedStruct::requestId, XmlBlasterConnectionUnparsedStruct::secretSessionId, XmlBlasterConnectionUnparsedStruct::shutdown, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp, XmlBlasterConnectionUnparsedStruct::subscribe, XmlBlasterConnectionUnparsedStruct::unSubscribe, XmlBlasterReadFromSocketFuncHolder::userP, XmlBlasterWriteToSocketFuncHolder::userP, XmlBlasterConnectionUnparsedStruct::useUdpForOneway, XmlBlasterConnectionUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, xmlBlasterConnect(), xmlBlasterConnectionShutdown(), xmlBlasterDefaultLogging(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), xmlBlasterUnSubscribe(), XmlBlasterConnectionUnparsedStruct::zlibReadBuf, and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Here is the call graph for this function:

IMAGE
static int initConnection (XmlBlasterConnectionUnparsed * xb, XmlBlasterException * exception) [static]
Connects on TCP/IP level to xmlBlaster. 

Returns:
true If the low level TCP/IP connect to xmlBlaster succeeded 

Definition at line 131 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterZlibReadBuffers::debug, XmlBlasterZlibWriteBuffers::debug, ExceptionStruct::errorCode, PropertiesStruct::getBool, gethostbyname_re(), PropertiesStruct::getInt, PropertiesStruct::getString, XmlBlasterConnectionUnparsedStruct::isInitialized, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, MAX_ERRNO_LEN, ExceptionStruct::message, XmlBlasterConnectionUnparsedStruct::props, XmlBlasterConnectionUnparsedStruct::readFromSocket, XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP, readnCompressed(), readnPlain(), XmlBlasterConnectionUnparsedStruct::secretSessionId, SNPRINTF, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp, strncpy0(), XmlBlasterConnectionUnparsedStruct::useUdpForOneway, writenCompressed(), writenPlain(), XmlBlasterConnectionUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, xb_strerror(), xmlBlaster_initZlibReader(), xmlBlaster_initZlibWriter(), XMLBLASTER_LOG_DUMP, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, XMLBLASTER_LOG_WARN, XMLBLASTEREXCEPTION_ERRORCODE_LEN, XMLBLASTEREXCEPTION_MESSAGE_LEN, XmlBlasterConnectionUnparsedStruct::zlibReadBuf, and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Referenced by getXmlBlasterConnectionUnparsed(), and xmlBlasterConnect().
Here is the call graph for this function:

IMAGE
static int isConnected (XmlBlasterConnectionUnparsed * xb) [static]

Definition at line 509 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster.static ssize_t readnCompressed (void * userP, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2) [static]
Compress data and send to socket. 

Definition at line 1363 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, XMLBLASTER_LOG_TRACE, xmlBlaster_readnCompressed(), and XmlBlasterConnectionUnparsedStruct::zlibReadBuf.
Here is the call graph for this function:

IMAGE
static ssize_t readnPlain (void * xb, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2) [static]
Write uncompressed to socket (not thread safe). 

Definition at line 1354 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, readn(), and XMLBLASTER_LOG_TRACE.
Here is the call graph for this function:

IMAGE
static int sendData (XmlBlasterConnectionUnparsed * xb, char * methodName, enum XMLBLASTER_MSG_TYPE_ENUM msgType, char * data_, size_t dataLen_, SocketDataHolder * responseSocketDataHolder, XmlBlasterException * exception, int udp) [static]
Send a message over the socket to xmlBlaster. 

Parameters:
xb The this pointer 
methodName The name of the remote method to invoke e.g. "connect" 
msgType The type of message: INVOKE, RESPONSE, EXCEPTION 
data The message payload to send, we take a clone so you can do with it what you want 
dataLen The length of data in bytes 
responseSocketDataHolder The returned data, you need to free it with free(response->data) if we returned true. Supply NULL for oneway messages. 
exception The exception struct, exception->errorCode is filled on exception. You need to supply it. 
udp Whether to use UDP or TCP. Supply true for UDP. 
Returns:
true if OK and response is filled (if not oneway or exception or response itself)
 false on error and exception is filled 

Definition at line 581 of file XmlBlasterConnectionUnparsed.c.
References MsgRequestInfoStruct::blob, blobcpyAlloc(), blobDump(), convertToXmlBlasterException(), BlobHolder::data, BlobHolder::dataLen, encodeSocketMessage(), ExceptionStruct::errorCode, freeBlobDump(), freeBlobHolderContent(), getResponse(), initializeXmlBlasterException(), XmlBlasterConnectionUnparsedStruct::isConnected, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, MAX_METHODNAME_LEN, MAX_REQUESTID_LEN, ExceptionStruct::message, MsgRequestInfoStruct::methodName, MSG_TYPE_EXCEPTION, XmlBlasterConnectionUnparsedStruct::postSendEvent, XmlBlasterConnectionUnparsedStruct::preSendEvent, XmlBlasterConnectionUnparsedStruct::preSendEvent_userP, XmlBlasterConnectionUnparsedStruct::requestId, MsgRequestInfoStruct::requestIdStr, MsgRequestInfoStruct::responseType, MsgRequestInfoStruct::rollback, XmlBlasterConnectionUnparsedStruct::secretSessionId, SNPRINTF, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp, strncpy0(), XmlBlasterWriteToSocketFuncHolder::userP, XmlBlasterConnectionUnparsedStruct::writeToSocket, XmlBlasterWriteToSocketFuncHolder::writeToSocketFuncP, MsgRequestInfoStruct::xa, xbl_isOneway(), XMLBLASTER_CONNECT, XMLBLASTER_LOG_DUMP, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_TRACE, XMLBLASTER_LOG_WARN, XMLBLASTER_SOCKET_VERSION, xmlBlasterConnectionShutdown(), XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
Here is the call graph for this function:

IMAGE
static ssize_t writenCompressed (void * xb, int fd, char * ptr, size_t nbytes) [static]
Compress data and send to socket. 

Definition at line 1345 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, XMLBLASTER_LOG_TRACE, xmlBlaster_writenCompressed(), and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Here is the call graph for this function:

IMAGE
static ssize_t writenPlain (void * xb, int fd, char * ptr, size_t nbytes) [static]
Write uncompressed to socket (not thread safe). 

Definition at line 1336 of file XmlBlasterConnectionUnparsed.c.
References XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, writen(), and XMLBLASTER_LOG_TRACE.
Here is the call graph for this function:

IMAGE
static char * xmlBlasterConnect (XmlBlasterConnectionUnparsed * xb, char * qos, XmlBlasterException * exception) [static]
Connect to the server. 

Parameters:
qos The QoS to connect 
The exception struct, exception->errorCode is filled on exception 
Returns:
The raw ConnectReturnQos XML string returned from xmlBlaster, only NULL if an exception is thrown. You need to free() it 
The ConnectReturnQos raw xml string, you need to free() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.connect.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 799 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), initConnection(), XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, MAX_SECRETSESSIONID_LEN, ExceptionStruct::message, MSG_TYPE_INVOKE, XmlBlasterConnectionUnparsedStruct::secretSessionId, sendData(), SNPRINTF, SOCKET_TCP, strFromBlobAlloc(), strncpy0(), XMLBLASTER_CONNECT, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
static void xmlBlasterConnectionShutdown (XmlBlasterConnectionUnparsed * xb) [static]
Used internally only, does no disconnect, only cleanup of socket. 

Definition at line 545 of file XmlBlasterConnectionUnparsed.c.
References closeSocket(), XmlBlasterConnectionUnparsedStruct::isConnected, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, XmlBlasterConnectionUnparsedStruct::socketToXmlBlaster, XmlBlasterConnectionUnparsedStruct::socketToXmlBlasterUdp, and XMLBLASTER_LOG_TRACE.
Referenced by freeXmlBlasterConnectionUnparsed(), getXmlBlasterConnectionUnparsed(), sendData(), and xmlBlasterDisconnect().
Here is the call graph for this function:

IMAGE
char* xmlBlasterConnectionUnparsedUsage ()
Help usage. 

Definition at line 514 of file XmlBlasterConnectionUnparsed.c.
References strncat0(), and strncpy0().
Referenced by xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE
static int xmlBlasterDisconnect (XmlBlasterConnectionUnparsed * xb, char * qos, XmlBlasterException * exception) [static]
Disconnect from server. 

Parameters:
qos The QoS to disconnect 
The exception struct, exception->errorCode is filled on exception 
Returns:
false on exception 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.disconnect.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 858 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), freeBlobHolderContent(), MSG_TYPE_INVOKE, XmlBlasterConnectionUnparsedStruct::secretSessionId, sendData(), SOCKET_TCP, XMLBLASTER_DISCONNECT, and xmlBlasterConnectionShutdown().
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterErase (XmlBlasterConnectionUnparsed * xb, char * key, char * qos, XmlBlasterException * exception) [static]
Erase a message from the server. 

Returns:
A struct holding the raw QoS XML strings returned from xmlBlaster, only NULL if an exception is thrown. You need to freeQosArr() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.erase.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1197 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), QosStructArr::len, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, ExceptionStruct::message, MSG_TYPE_INVOKE, parseQosArr(), QosStructArr::qosArr, sendData(), SNPRINTF, SOCKET_TCP, strncpy0(), XMLBLASTER_ERASE, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
static MsgUnitArr * xmlBlasterGet (XmlBlasterConnectionUnparsed * xb, char * key, char * qos, XmlBlasterException * exception) [static]
Get a message. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.get.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
NULL on error, please check exception in such a case, you need to call freeMsgUnitArr(msgUnitArr); after usage. 

Definition at line 1286 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), MsgUnitStructArr::len, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, ExceptionStruct::message, MSG_TYPE_INVOKE, parseMsgUnitArr(), sendData(), SNPRINTF, SOCKET_TCP, strncpy0(), XMLBLASTER_GET, XMLBLASTER_LOG_TRACE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
static int xmlBlasterInitQueue (XmlBlasterConnectionUnparsed * xb, QueueProperties * queueProperties, XmlBlasterException * exception) [static]
Set the queue properties. 

Example: 
   QueueProperties queueProperties;   strncpy0(queueProperties.dbName, "xmlBlasterClient.db", QUEUE_DBNAME_MAX);   strncpy0(queueProperties.nodeId, "clientJoe1081594557415", QUEUE_ID_MAX);   strncpy0(queueProperties.queueName, "connection_clientJoe", QUEUE_ID_MAX);   strncpy0(queueProperties.tablePrefix, "XB_", QUEUE_PREFIX_MAX);   queueProperties.maxNumOfEntries = 10000000L;   queueProperties.maxNumOfBytes = 1000000000LL; 
 
Parameters:
queueProperties The queue configuration,        if 0 or parts of it are empty it will be initialized by environment settings 
Returns:
 true on success 
Exceptions:
exception if already initialized or if initialization fails

Definition at line 449 of file XmlBlasterConnectionUnparsed.c.
References checkArgs(), createQueue(), QueueProperties::dbName, embedException(), ExceptionStruct::errorCode, PropertiesStruct::getInt, PropertiesStruct::getInt64, PropertiesStruct::getString, XmlBlasterConnectionUnparsedStruct::log, QueueProperties::logFp, QueueProperties::logLevel, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, ExceptionStruct::message, XmlBlasterConnectionUnparsedStruct::props, QUEUE_DBNAME_MAX, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueProperties::queueName, XmlBlasterConnectionUnparsedStruct::queueP, SNPRINTF, strncpy0(), QueueProperties::tablePrefix, I_QueueStruct::userObject, QueueProperties::userObject, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_WARN, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
static char * xmlBlasterPing (XmlBlasterConnectionUnparsed * xb, char * qos, XmlBlasterException * exception) [static]
Ping the server. 

Parameters:
qos The QoS or 0 
exception *errorCode!=0 on failure 
Returns:
The ping return QoS raw xml string, you need to free() it or 0 on failure (in which case *exception.errorCode!='') 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1259 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), BlobHolder::data, BlobHolder::dataLen, freeBlobHolderContent(), XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, MSG_TYPE_INVOKE, sendData(), SOCKET_TCP, strFromBlobAlloc(), XMLBLASTER_LOG_TRACE, and XMLBLASTER_PING.
Here is the call graph for this function:

IMAGE
static char * xmlBlasterPublish (XmlBlasterConnectionUnparsed * xb, MsgUnit * msgUnit, XmlBlasterException * exception) [static]
Publish a message to the server. 

Returns:
The raw XML string returned from xmlBlaster, only NULL if an exception is thrown You need to free() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 967 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), BlobHolder::data, BlobHolder::dataLen, encodeMsgUnit(), ExceptionStruct::errorCode, freeBlobHolderContent(), XmlBlasterConnectionUnparsedStruct::logLevel, MSG_TYPE_INVOKE, MsgUnit::qos, MsgUnit::responseQos, sendData(), SOCKET_TCP, strFromBlobAlloc(), XMLBLASTER_LOG_DUMP, and XMLBLASTER_PUBLISH.
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterPublishArr (XmlBlasterConnectionUnparsed * xb, MsgUnitArr * msgUnitArr, XmlBlasterException * exception) [static]
Publish a message array in a bulk to the server. 

Returns:
The raw XML string array returned from xmlBlaster, only NULL if an exception is thrown You need to free() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1009 of file XmlBlasterConnectionUnparsed.c.
References checkArgs(), BlobHolder::data, BlobHolder::dataLen, encodeMsgUnitArr(), MsgUnitStructArr::len, XmlBlasterConnectionUnparsedStruct::logLevel, MSG_TYPE_INVOKE, MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, sendData(), SOCKET_TCP, XMLBLASTER_LOG_DUMP, and XMLBLASTER_PUBLISH.
Here is the call graph for this function:

IMAGE
static void xmlBlasterPublishOneway (XmlBlasterConnectionUnparsed * xb, MsgUnitArr * msgUnitArr, XmlBlasterException * exception) [static]
Publish oneway a message array in a bulk to the server without receiving an ACK. 

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1040 of file XmlBlasterConnectionUnparsed.c.
References checkArgs(), BlobHolder::data, BlobHolder::dataLen, encodeMsgUnitArr(), MsgUnitStructArr::len, XmlBlasterConnectionUnparsedStruct::logLevel, MSG_TYPE_INVOKE, MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, sendData(), XmlBlasterConnectionUnparsedStruct::useUdpForOneway, XMLBLASTER_LOG_DUMP, and XMLBLASTER_PUBLISH_ONEWAY.
Here is the call graph for this function:

IMAGE
static char * xmlBlasterSubscribe (XmlBlasterConnectionUnparsed * xb, char * key, char * qos, XmlBlasterException * exception) [static]
Subscribe a message. 

Returns:
The raw XML string returned from xmlBlaster, only NULL if an exception is thrown You need to free() it 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.subscribe.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1079 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, ExceptionStruct::message, MSG_TYPE_INVOKE, sendData(), SNPRINTF, SOCKET_TCP, strFromBlobAlloc(), strncpy0(), XMLBLASTER_LOG_TRACE, XMLBLASTER_SUBSCRIBE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE
static QosArr * xmlBlasterUnSubscribe (XmlBlasterConnectionUnparsed * xb, char * key, char * qos, XmlBlasterException * exception) [static]
UnSubscribe a message from the server. 

Returns:
The raw QoS XML strings returned from xmlBlaster, only NULL if an exception is thrown You need to free it with freeQosArr() after usage 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.unSubscribe.html 
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 

Definition at line 1135 of file XmlBlasterConnectionUnparsed.c.
References SocketDataHolder::blob, checkArgs(), BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, freeBlobHolderContent(), QosStructArr::len, XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, ExceptionStruct::message, MSG_TYPE_INVOKE, parseQosArr(), QosStructArr::qosArr, sendData(), SNPRINTF, SOCKET_TCP, strncpy0(), XMLBLASTER_LOG_TRACE, XMLBLASTER_UNSUBSCRIBE, XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Here is the call graph for this function:

IMAGE

socket/xmlBlasterSocket.c File Reference
#include <stdio.h>
#include <string.h>
#include <socket/xmlBlasterSocket.h>

Include dependency graph for xmlBlasterSocket.c:

IMAGE

Functions
void closeSocket (int fd)
ssize_t writen (int fd, char *ptr, size_t nbytes)
Write the given amount of bytes to socket. 

ssize_t readn (int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP)
Read the given amount of bytes from socket. 

int xbl_isOneway (XMLBLASTER_MSG_TYPE msgType, char *methodName)
Check if the given arguments mark a oneway message. 

BlobHolder encodeMsgUnit (MsgUnit *msgUnit, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

BlobHolder encodeMsgUnitArr (MsgUnitArr *msgUnitArr, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

char * encodeSocketMessage (enum XMLBLASTER_MSG_TYPE_ENUM msgType, char *requestId, char *methodName, char *secretSessionId, char *data, size_t dataLen, int debug, size_t *rawMsgLen)
int parseSocketData (int xmlBlasterSocket, XmlBlasterReadFromSocketFuncHolder *fpHolder, SocketDataHolder *socketDataHolder, XmlBlasterException *exception, int *stopP, int udp, int debug)
Read a message from the given socket. 

void convertToXmlBlasterException (XmlBlasterBlob *blob, XmlBlasterException *exception, int debug)
The blob data is copied into the given exception object. 

void encodeXmlBlasterException (XmlBlasterBlob *blob, XmlBlasterException *exception, int debug)
The given exception is dumped into the blob data. 

QosArr * parseQosArr (size_t dataLen, char *data)
Parses the QoS XML string array returned by erase() and unSubscribe(). 

MsgUnitArr * parseMsgUnitArr (size_t dataLen, char *data)
Parses the userData part of a raw socket message and fills an array of MsgUnit structs. 

Function Documentation
void closeSocket (int fd)

Definition at line 12 of file xmlBlasterSocket.c.
Referenced by closeAcceptSocket(), shutdownCallbackServer(), and xmlBlasterConnectionShutdown().void convertToXmlBlasterException (XmlBlasterBlob * blob, XmlBlasterException * exception, int debug)
The blob data is copied into the given exception object. 

Note: exception->remote is always set to true (assuming a remote blob) 

Definition at line 494 of file xmlBlasterSocket.c.
References BlobHolder::data, BlobHolder::dataLen, ExceptionStruct::errorCode, ExceptionStruct::message, ExceptionStruct::remote, strncpy0(), trim(), XMLBLASTEREXCEPTION_ERRORCODE_LEN, and XMLBLASTEREXCEPTION_MESSAGE_LEN.
Referenced by postSendEvent(), and sendData().
Here is the call graph for this function:

IMAGE
BlobHolder encodeMsgUnit (MsgUnit * msgUnit, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

Parameters:
msgUnit The message which we need to send 
debug Pass true for debugging output to stdout 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
The raw 'serialized' MsgUnit as a char* in BlobHolder, the caller needs to free() it. 

Definition at line 119 of file xmlBlasterSocket.c.
References MsgUnit::content, MsgUnit::contentLen, BlobHolder::data, BlobHolder::dataLen, MsgUnit::key, MsgUnit::qos, and SNPRINTF.
Referenced by encodeXmlBlasterException(), sendResponse(), sendXmlBlasterException(), and xmlBlasterPublish().BlobHolder encodeMsgUnitArr (MsgUnitArr * msgUnitArr, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

Parameters:
msgUnitArr An array of messages 
debug Set to true if you wish debugging output to stdout 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
The raw 'serialized' MsgUnitArr as a char*, the caller needs to free() it. 

Definition at line 176 of file xmlBlasterSocket.c.
References MsgUnit::contentLen, BlobHolder::dataLen, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, and snprintf0().
Referenced by xmlBlasterPublishArr(), and xmlBlasterPublishOneway().
Here is the call graph for this function:

IMAGE
char* encodeSocketMessage (enum XMLBLASTER_MSG_TYPE_ENUM msgType, char * requestId, char * methodName, char * secretSessionId, char * data, size_t dataLen, int debug, size_t * rawMsgLen)

Definition at line 249 of file xmlBlasterSocket.c.
References MAX_METHODNAME_LEN, MAX_SESSIONID_LEN, MSG_FLAG_POS_TYPE, MSG_FLAG_POS_VERSION, MSG_LEN_FIELD_LEN, MSG_POS_REQESTID, snprintf0(), toReadableDump(), and XMLBLASTER_SOCKET_VERSION.
Referenced by sendData(), sendResponse(), and sendXmlBlasterException().
Here is the call graph for this function:

IMAGE
void encodeXmlBlasterException (XmlBlasterBlob * blob, XmlBlasterException * exception, int debug)
The given exception is dumped into the blob data. 

Parameters:
blob The encoded exception, you need to free the blob struct yourself after usage with freeBlobHolderContent(&blob); 
exception The given exception struct 
debug Print output to stdout 

Definition at line 515 of file xmlBlasterSocket.c.
References BlobHolder::data, BlobHolder::dataLen, encodeMsgUnit(), ExceptionStruct::errorCode, MsgUnit::key, ExceptionStruct::message, and MsgUnit::qos.
Referenced by handleMessage().
Here is the call graph for this function:

IMAGE
MsgUnitArr* parseMsgUnitArr (size_t dataLen, char * data)
Parses the userData part of a raw socket message and fills an array of MsgUnit structs. 

Returns:
The messages (never NULL), you need to free them after usage with freeMsgUnitArr(MsgUnitArr *) 

Definition at line 553 of file xmlBlasterSocket.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnitStructArr::isOneway, MsgUnit::key, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, strcpyAlloc(), strncpy0(), strToULong(), and trim().
Referenced by parseQosArr(), and xmlBlasterGet().
Here is the call graph for this function:

IMAGE
QosArr* parseQosArr (size_t dataLen, char * data)
Parses the QoS XML string array returned by erase() and unSubscribe(). 

Returns:
The returned status QoS, never null, needs to be freed with freeQosArr() after usage. 

Definition at line 534 of file xmlBlasterSocket.c.
References freeMsgUnitArr(), QosStructArr::len, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, parseMsgUnitArr(), MsgUnit::qos, QosStructArr::qosArr, and strcpyAlloc().
Referenced by xmlBlasterErase(), and xmlBlasterUnSubscribe().
Here is the call graph for this function:

IMAGE
int parseSocketData (int xmlBlasterSocket, XmlBlasterReadFromSocketFuncHolder * fpHolder, SocketDataHolder * socketDataHolder, XmlBlasterException * exception, int * stopP, int udp, int debug)
Read a message from the given socket. 

This method blocks until data arrives.
Parameters:
xmlBlasterSocket The socket to read data from (needs to be valid) 
fpHolder Struct containing the function pointer which access the socket to read from (if necessary decompressing on the fly) 
socketDataHolder The struct to put the parsed message into (needs to be allocated by you or on your stack) 
exception The struct to put exceptions into (needs to be allocated by you or to be on your stack) 
stopP The *stopP may change to 'true' during receiv() blocking 
udp true if it is a UDP connection 
debug Set to true to have debugging output on console 
Returns:
true: A messages is parsed and put into your socketDataHolder, you need to free(socketDataHolder->data) after working with it. Please check socketDataHolder->type if it is an exception. false: The socket is closed (EOF) 

Definition at line 330 of file xmlBlasterSocket.c.
References SocketDataHolder::blob, BlobHolder::data, BlobHolder::dataLen, SocketDataHolder::dataLenUncompressed, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_MESSAGE_LEN, MAX_METHODNAME_LEN, MAX_MSG_LEN, MAX_PACKET_SIZE, MAX_REQUESTID_LEN, MAX_SESSIONID_LEN, ExceptionStruct::message, SocketDataHolder::methodName, MSG_FLAG_POS_TYPE, MSG_FLAG_POS_VERSION, MSG_LEN_FIELD_LEN, MSG_POS_REQESTID, MSG_TYPE_EXCEPTION, MSG_TYPE_INVOKE, MSG_TYPE_RESPONSE, SocketDataHolder::msgLen, XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, XmlBlasterReadFromSocketFuncHolder::readFromSocketFuncP, ExceptionStruct::remote, SocketDataHolder::requestId, SocketDataHolder::secretSessionId, snprintf0(), strncpy0(), strToULong(), toReadableDump(), trim(), SocketDataHolder::type, XmlBlasterReadFromSocketFuncHolder::userP, SocketDataHolder::version, XMLBLASTER_SOCKET_VERSION, and XMLBLASTEREXCEPTION_ERRORCODE_LEN.
Referenced by getResponse(), and readMessage().
Here is the call graph for this function:

IMAGE
ssize_t readn (int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP)
Read the given amount of bytes from socket. 

This method blocks until data arrives, we loop as the low level recv() can return when the socket buffer is empty but not all data expected arrived.
This code is not thread safe, you need to add a mutex to your calling code if two threads simultaneously want to read from the same socket 'fd'.
Parameters:
fd The socket descriptor 
ptr A buffer which is big enough to hold nbytes 
nbytes The number of bytes to read 
fpNumRead Function pointer, if not null we make a callback about the progress 
userP Is bounced back to fpNumRead 
Returns:
number of bytes read, -1 is EOF 
Author:
W. Richard Stevens 

Definition at line 68 of file xmlBlasterSocket.c.
Referenced by readnPlain().ssize_t writen (int fd, char * ptr, size_t nbytes)
Write the given amount of bytes to socket. 

This method blocks until data all data is sent, we loop as the low level write() can return when the socket buffer is full but not all data expected are sent.
This code is not thread safe, you need to add a mutex to your calling code if two threads simultaneously want to read from the same socket 'fd'.
Returns:
number of bytes written, -1 is EOF 
Author:
W. Richard Stevens 

Definition at line 33 of file xmlBlasterSocket.c.
Referenced by writenPlain(), and xmlBlaster_writenCompressed().int xbl_isOneway (XMLBLASTER_MSG_TYPE msgType, char * methodName)
Check if the given arguments mark a oneway message. 

Parameters:
msgType The message type like MSG_TYPE_INVOKE 
methodName The name of the invoked message like "publish", can be null 
Returns:
if true it is treated as oneway 

Definition at line 100 of file xmlBlasterSocket.c.
References MSG_TYPE_EXCEPTION, MSG_TYPE_RESPONSE, and XMLBLASTER_PUBLISH_ONEWAY.
Referenced by preSendEvent(), and sendData().

socket/xmlBlasterSocket.h File Reference
#include <stdlib.h>
#include <util/basicDefs.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <util/msgUtil.h>

Include dependency graph for xmlBlasterSocket.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct SocketDataHolder
Helper struct to hold all necessary informations. 

Defines
#define MAX_MSG_LEN  1000000000
#define MSG_LEN_FIELD_LEN  10
#define MAX_PACKET_SIZE  10*1024
#define MSG_FLAG_FIELD_LEN  6
#define XMLBLASTER_SOCKET_VERSION  49
Typedefs
typedef enum XMLBLASTER_MSG_TYPE_ENUM XMLBLASTER_MSG_TYPE
Settings for MSG_FLAG_POS_TYPE. 

Enumerations
enum XMLBLASTER_MSG_TYPE_ENUM { MSG_TYPE_INVOKE =  73, MSG_TYPE_RESPONSE =  82, MSG_TYPE_EXCEPTION =  69 }
Settings for MSG_FLAG_POS_TYPE. 

enum MSG_FLAG_POS_ENUM { MSG_FLAG_POS_CHECKSUM =  10, MSG_FLAG_POS_COMPRESS, MSG_FLAG_POS_TYPE, MSG_FLAG_POS_RESERVED1, MSG_FLAG_POS_RESERVED2, MSG_FLAG_POS_VERSION, MSG_POS_REQESTID }
Functions
void closeSocket (int fd)
ssize_t writen (const int fd, const char *ptr, const size_t nbytes)
ssize_t readn (const int fd, char *ptr, const size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP)
Read the given amount of bytes from socket. 

int xbl_isOneway (XMLBLASTER_MSG_TYPE msgType, const char *const methodName)
char * encodeSocketMessage (enum XMLBLASTER_MSG_TYPE_ENUM msgType, const char *const requestId, const char *const methodName, const char *const secretSessionId, const char *data, size_t dataLen, int debug, size_t *rawMsgLen)
Creates a raw blob to push over a socket as described in the protocol.socket requirement. 

BlobHolder encodeMsgUnit (MsgUnit *msgUnit, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

BlobHolder encodeMsgUnitArr (MsgUnitArr *msgUnitArr, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

int parseSocketData (int xmlBlasterSocket, const XmlBlasterReadFromSocketFuncHolder *fpHolder, SocketDataHolder *socketDataHolder, XmlBlasterException *exception, int *stopP, int udp, int debug)
void convertToXmlBlasterException (const XmlBlasterBlob *blob, XmlBlasterException *exception, int debug)
void encodeXmlBlasterException (XmlBlasterBlob *blob, const XmlBlasterException *exception, int debug)
MsgUnitArr * parseMsgUnitArr (size_t dataLen, char *data)
Parses the userData part of a raw socket message and fills an array of MsgUnit structs. 

QosArr * parseQosArr (size_t dataLen, char *data)
Parses the QoS XML string array returned by erase() and unSubscribe(). 

Define Documentation
#define MAX_MSG_LEN  1000000000

Definition at line 49 of file xmlBlasterSocket.h.
Referenced by parseSocketData().#define MAX_PACKET_SIZE  10*1024

Definition at line 77 of file xmlBlasterSocket.h.
Referenced by parseSocketData().#define MSG_FLAG_FIELD_LEN  6

Definition at line 78 of file xmlBlasterSocket.h.#define MSG_LEN_FIELD_LEN  10

Definition at line 76 of file xmlBlasterSocket.h.
Referenced by encodeSocketMessage(), and parseSocketData().#define XMLBLASTER_SOCKET_VERSION  49

Definition at line 90 of file xmlBlasterSocket.h.
Referenced by encodeSocketMessage(), parseSocketData(), and sendData().
Typedef Documentation
typedef enum XMLBLASTER_MSG_TYPE_ENUM  XMLBLASTER_MSG_TYPE
Settings for MSG_FLAG_POS_TYPE. 

Enumeration Type Documentation
enum MSG_FLAG_POS_ENUM

Enumerator: 
MSG_FLAG_POS_CHECKSUM  
MSG_FLAG_POS_COMPRESS  
MSG_FLAG_POS_TYPE  
MSG_FLAG_POS_RESERVED1  
MSG_FLAG_POS_RESERVED2  
MSG_FLAG_POS_VERSION  
MSG_POS_REQESTID  

Definition at line 80 of file xmlBlasterSocket.h.enum XMLBLASTER_MSG_TYPE_ENUM
Settings for MSG_FLAG_POS_TYPE. 

Enumerator: 
MSG_TYPE_INVOKE  
MSG_TYPE_RESPONSE  
MSG_TYPE_EXCEPTION  

Definition at line 54 of file xmlBlasterSocket.h.
Function Documentation
void closeSocket (int fd)

Definition at line 12 of file xmlBlasterSocket.c.
Referenced by closeAcceptSocket(), shutdownCallbackServer(), and xmlBlasterConnectionShutdown().void convertToXmlBlasterException (const XmlBlasterBlob * blob, XmlBlasterException * exception, int debug)
BlobHolder encodeMsgUnit (MsgUnit * msgUnit, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

Parameters:
msgUnit The message which we need to send 
debug Pass true for debugging output to stdout 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
The raw 'serialized' MsgUnit as a char* in BlobHolder, the caller needs to free() it. 

Definition at line 119 of file xmlBlasterSocket.c.
References MsgUnit::content, MsgUnit::contentLen, BlobHolder::data, BlobHolder::dataLen, MsgUnit::key, MsgUnit::qos, and SNPRINTF.
Referenced by encodeXmlBlasterException(), sendResponse(), sendXmlBlasterException(), and xmlBlasterPublish().BlobHolder encodeMsgUnitArr (MsgUnitArr * msgUnitArr, int debug)
Creates a raw blob to push over a socket as described in protocol.socket. 

Parameters:
msgUnitArr An array of messages 
debug Set to true if you wish debugging output to stdout 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
The raw 'serialized' MsgUnitArr as a char*, the caller needs to free() it. 

Definition at line 176 of file xmlBlasterSocket.c.
References MsgUnit::contentLen, BlobHolder::dataLen, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, and snprintf0().
Referenced by xmlBlasterPublishArr(), and xmlBlasterPublishOneway().
Here is the call graph for this function:

IMAGE
char* encodeSocketMessage (enum XMLBLASTER_MSG_TYPE_ENUM msgType, const char *const requestId, const char *const methodName, const char *const secretSessionId, const char * data, size_t dataLen, int debug, size_t * rawMsgLen)
Creates a raw blob to push over a socket as described in the protocol.socket requirement. 

Parameters:
msgType invoke, response or exception 
requestId The unique request ID for each invocation 
methodName The method name like "PUBLISH" 
secretSessionId The authentication string 
data is returned 
dataLen is returned 
debug Pass true for debugging output to stdout 
rawMsgLen 
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html 
Returns:
The raw message, the caller needs to free() it. 

Parameters: 
requestId  The unique request ID for each invocation 

void encodeXmlBlasterException (XmlBlasterBlob * blob, const XmlBlasterException * exception, int debug)
MsgUnitArr* parseMsgUnitArr (size_t dataLen, char * data)
Parses the userData part of a raw socket message and fills an array of MsgUnit structs. 

Returns:
The messages (never NULL), you need to free them after usage with freeMsgUnitArr(MsgUnitArr *) 

Definition at line 553 of file xmlBlasterSocket.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnitStructArr::isOneway, MsgUnit::key, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, strcpyAlloc(), strncpy0(), strToULong(), and trim().
Referenced by parseQosArr(), and xmlBlasterGet().
Here is the call graph for this function:

IMAGE
QosArr* parseQosArr (size_t dataLen, char * data)
Parses the QoS XML string array returned by erase() and unSubscribe(). 

Returns:
The returned status QoS, never null, needs to be freed with freeQosArr() after usage. 

Definition at line 534 of file xmlBlasterSocket.c.
References freeMsgUnitArr(), MsgUnitStructArr::len, QosStructArr::len, MsgUnitStructArr::msgUnitArr, parseMsgUnitArr(), MsgUnit::qos, QosStructArr::qosArr, and strcpyAlloc().
Referenced by xmlBlasterErase(), and xmlBlasterUnSubscribe().
Here is the call graph for this function:

IMAGE
int parseSocketData (int xmlBlasterSocket, const XmlBlasterReadFromSocketFuncHolder * fpHolder, SocketDataHolder * socketDataHolder, XmlBlasterException * exception, int * stopP, int udp, int debug)
ssize_t readn (int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP)
Read the given amount of bytes from socket. 

This method blocks until data arrives, we loop as the low level recv() can return when the socket buffer is empty but not all data expected arrived.
This code is not thread safe, you need to add a mutex to your calling code if two threads simultaneously want to read from the same socket 'fd'.
Parameters:
fd The socket descriptor 
ptr A buffer which is big enough to hold nbytes 
nbytes The number of bytes to read 
fpNumRead Function pointer, if not null we make a callback about the progress 
userP Is bounced back to fpNumRead 
Returns:
number of bytes read, -1 is EOF 
Author:
W. Richard Stevens 

Definition at line 68 of file xmlBlasterSocket.c.
Referenced by readnPlain().ssize_t writen (const int fd, const char * ptr, const size_t nbytes)
int xbl_isOneway (XMLBLASTER_MSG_TYPE msgType, const char *const methodName)

socket/XmlBlasterUnmanaged.c File Reference
#include <string.h>
#include <stdio.h>
#include <XmlBlasterUnmanaged.h>

Include dependency graph for XmlBlasterUnmanaged.c:

IMAGE

Functions
static void convert (XmlBlasterException *in, XmlBlasterUnmanagedException *out)
static int interceptUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
We intercept the callbacks here and convert it to a more simple form to be easy transferable to C# (Csharp). 

XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsedUnmanaged (int argc, char **argv)
void freeXmlBlasterAccessUnparsedUnmanaged (XmlBlasterAccessUnparsed *xmlBlasterAccess)
int xmlBlasterUnmanagedInitialize (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException *exception)
char * xmlBlasterUnmanagedConnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException *exception)
int xmlBlasterUnmanagedDisconnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedException *exception)
char * xmlBlasterUnmanagedPublish (struct XmlBlasterAccessUnparsed *xa, MsgUnit *msgUnit, XmlBlasterUnmanagedException *exception)
QosArr * xmlBlasterUnmanagedPublishArr (struct XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterUnmanagedException *exception)
void xmlBlasterUnmanagedPublishOneway (struct XmlBlasterAccessUnparsed *xa, MsgUnit *msgUnitArr, int length, XmlBlasterUnmanagedException *exception)
char * xmlBlasterUnmanagedSubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedException *exception)
void xmlBlasterUnmanagedUnSubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, XmlBlasterUnmanagedStringArr **ppStruct)
void xmlBlasterUnmanagedErase (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, XmlBlasterUnmanagedStringArr **ppStruct)
void xmlBlasterUnmanagedGet (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, MsgUnit **ppStruct)
char * xmlBlasterUnmanagedPing (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedException *exception)
int xmlBlasterUnmanagedIsConnected (struct XmlBlasterAccessUnparsed *xa)
char * xmlBlasterUnmanagedUsage ()

Function Documentation
static void convert (XmlBlasterException * in, XmlBlasterUnmanagedException * out) [static]

Definition at line 22 of file XmlBlasterUnmanaged.c.
References ExceptionStruct::errorCode, XmlBlasterUnmanagedException::errorCode, ExceptionStruct::message, XmlBlasterUnmanagedException::message, ExceptionStruct::remote, XmlBlasterUnmanagedException::remote, and strcpyAlloc().
Referenced by xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEDisconnect(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEInitialize(), xmlBlasterUnmanagedCEPing(), xmlBlasterUnmanagedCEPublish(), xmlBlasterUnmanagedCEPublishArr(), xmlBlasterUnmanagedCEPublishOneway(), xmlBlasterUnmanagedCESubscribe(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedConnect(), xmlBlasterUnmanagedDisconnect(), xmlBlasterUnmanagedErase(), xmlBlasterUnmanagedGet(), xmlBlasterUnmanagedInitialize(), xmlBlasterUnmanagedPing(), xmlBlasterUnmanagedPublish(), xmlBlasterUnmanagedPublishArr(), xmlBlasterUnmanagedPublishOneway(), xmlBlasterUnmanagedSubscribe(), and xmlBlasterUnmanagedUnSubscribe().
Here is the call graph for this function:

IMAGE
void freeXmlBlasterAccessUnparsedUnmanaged (XmlBlasterAccessUnparsed * xmlBlasterAccess)

Definition at line 97 of file XmlBlasterUnmanaged.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, and freeXmlBlasterAccessUnparsed().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsedUnmanaged (int argc, char ** argv)

argv seems to be freed by C#, so we clone it here 

Definition at line 87 of file XmlBlasterUnmanaged.c.
References getXmlBlasterAccessUnparsed(), and strcpyAlloc().
Here is the call graph for this function:

IMAGE
static int interceptUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * exception) [static]
We intercept the callbacks here and convert it to a more simple form to be easy transferable to C# (Csharp). 

Definition at line 32 of file XmlBlasterUnmanaged.c.
References MsgUnit::content, MsgUnit::contentLen, ExceptionStruct::errorCode, XmlBlasterUnmanagedException::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, MsgUnit::key, MsgUnitStructArr::len, ExceptionStruct::message, XmlBlasterUnmanagedException::message, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, ExceptionStruct::remote, XmlBlasterUnmanagedException::remote, MsgUnit::responseQos, MsgUnitStructArr::secretSessionId, strcpyAlloc(), strFromBlobAlloc(), strncpy0(), XmlBlasterAccessUnparsed::userFp, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedConnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException * exception)

Definition at line 116 of file XmlBlasterUnmanaged.c.
References XmlBlasterAccessUnparsed::connect, convert(), interceptUpdate(), and XmlBlasterAccessUnparsed::userFp.
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedDisconnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedException * exception)

Definition at line 126 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::disconnect.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedErase (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, XmlBlasterUnmanagedStringArr ** ppStruct)

Definition at line 192 of file XmlBlasterUnmanaged.c.
References convert(), XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedStringArr::str, and strcpyAlloc().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedGet (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, MsgUnit ** ppStruct)

Definition at line 216 of file XmlBlasterUnmanaged.c.
References MsgUnit::content, MsgUnit::contentLen, convert(), ExceptionStruct::errorCode, freeMsgUnitArr(), XmlBlasterAccessUnparsed::get, MsgUnit::key, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, MsgUnit::responseQos, strcpyAlloc(), and strFromBlobAlloc().
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedInitialize (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException * exception)

Definition at line 107 of file XmlBlasterUnmanaged.c.
References convert(), XmlBlasterAccessUnparsed::initialize, interceptUpdate(), and XmlBlasterAccessUnparsed::userFp.
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedIsConnected (struct XmlBlasterAccessUnparsed * xa)

Definition at line 253 of file XmlBlasterUnmanaged.c.
References XmlBlasterAccessUnparsed::isConnected.char* xmlBlasterUnmanagedPing (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedException * exception)

Definition at line 246 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::ping.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedPublish (struct XmlBlasterAccessUnparsed * xa, MsgUnit * msgUnit, XmlBlasterUnmanagedException * exception)

Definition at line 133 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::publish.
Here is the call graph for this function:

IMAGE
QosArr* xmlBlasterUnmanagedPublishArr (struct XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterUnmanagedException * exception)

Definition at line 140 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::publishArr.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedPublishOneway (struct XmlBlasterAccessUnparsed * xa, MsgUnit * msgUnitArr, int length, XmlBlasterUnmanagedException * exception)

Definition at line 147 of file XmlBlasterUnmanaged.c.
References convert(), MsgUnitStructArr::isOneway, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, XmlBlasterAccessUnparsed::publishOneway, and MsgUnitStructArr::secretSessionId.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedSubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedException * exception)

Definition at line 159 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::subscribe.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedUnSubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, XmlBlasterUnmanagedStringArr ** ppStruct)

Definition at line 166 of file XmlBlasterUnmanaged.c.
References convert(), ExceptionStruct::errorCode, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedStringArr::str, strcpyAlloc(), and XmlBlasterAccessUnparsed::unSubscribe.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedUsage ()

Definition at line 257 of file XmlBlasterUnmanaged.c.
References XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE

socket/XmlBlasterUnmanagedCE.c File Reference
#include <string.h>
#include <stdio.h>
#include <XmlBlasterUnmanagedCE.h>
#include <stdarg.h>
#include <locale.h>

Include dependency graph for XmlBlasterUnmanagedCE.c:

IMAGE

Defines
#define XBFORCE_EXTERNC
Functions
static void myLogger (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char *location, char *fmt,...)
void xmlBlasterUnmanagedCERegisterLogger (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCELoggerFp logger)
static void callbackProgressListener (void *userP, size_t currBytesRead, size_t nbytes)
Access the read socket progress. 

void xmlBlasterUnmanagedCERegisterProgressListener (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCECallbackProgressListenerFp csharpProgressListenerFp)
Called by managed C# code to register for progress notifications. 

char * xmlBlasterUnmanagedCEMalloc (int32_t size)
malloc size bytes 

void xmlBlasterUnmanagedCEFree (char *p)
Frees the malloced pointer. 

void xmlBlasterUnmanagedCEFreePP (char **pp)
Frees the content of the malloced pointer It is a hack as i don't know how to free the IntPtr which arrived as ** and was allocated on (*ppStruct) for example in unSubscribe(): So we call this function similar as the unSubscribe() . 

static void convert (XmlBlasterException *in, XmlBlasterUnmanagedCEException *out)
Allocates the members of XmlBlasterUnmanagedCEException You need to free it after usage. 

void xmlBlasterUnmanagedCEExceptionFree (XmlBlasterUnmanagedCEException *ex)
static int interceptUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
We intercept the callbacks here and convert it to a more simple form to be easy transferable to C# (Csharp). 

XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsedUnmanagedCE (int argc, char **argv)
void freeXmlBlasterAccessUnparsedUnmanagedCE (XmlBlasterAccessUnparsed *xmlBlasterAccess)
int xmlBlasterUnmanagedCEInitialize (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException *exception)
char * xmlBlasterUnmanagedCEConnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException *exception)
Your qos is freed. 

int xmlBlasterUnmanagedCEDisconnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEException *exception)
Your qos is freed. 

char * xmlBlasterUnmanagedCEPublish (struct XmlBlasterAccessUnparsed *xa, MsgUnitUnmanagedCEpublish *msgUnitUnmanaged, XmlBlasterUnmanagedCEException *exception)
QosArr * xmlBlasterUnmanagedCEPublishArr (struct XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterUnmanagedCEException *exception)
void xmlBlasterUnmanagedCEPublishOneway (struct XmlBlasterAccessUnparsed *xa, void *msgUnitArr, int length, XmlBlasterUnmanagedCEException *exception)
char * xmlBlasterUnmanagedCESubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception)
Your key and qos is freed. 

void xmlBlasterUnmanagedCEUnSubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, XmlBlasterUnmanagedCEStringArr **ppStruct)
void xmlBlasterUnmanagedCEErase (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, XmlBlasterUnmanagedCEStringArr **ppStruct)
void xmlBlasterUnmanagedCEGet (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, MsgUnitUnmanagedCEget **ppStruct)
char * xmlBlasterUnmanagedCEPing (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEException *exception)
int xmlBlasterUnmanagedCEIsConnected (struct XmlBlasterAccessUnparsed *xa)
char * xmlBlasterUnmanagedCEUsage ()
char * xmlBlasterUnmanagedCEVersion ()
char * getXmlBlasterEmei ()
You need to add cellcore.lib for compilation (WINCE). 

Variables
static int freeIt = 1

Define Documentation
#define XBFORCE_EXTERNC

Definition at line 22 of file XmlBlasterUnmanagedCE.c.
Function Documentation
static void callbackProgressListener (void * userP, size_t currBytesRead, size_t nbytes) [static]
Access the read socket progress. 

You need to register this function pointer if you want to see the progress of huge messages on slow connections. 

Definition at line 115 of file XmlBlasterUnmanagedCE.c.
Referenced by main(), and xmlBlasterUnmanagedCERegisterProgressListener().static void convert (XmlBlasterException * in, XmlBlasterUnmanagedCEException * out) [static]
Allocates the members of XmlBlasterUnmanagedCEException You need to free it after usage. 

Definition at line 186 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterUnmanagedCEException::errorCode, ExceptionStruct::errorCode, ExceptionStruct::message, XmlBlasterUnmanagedCEException::message, ExceptionStruct::remote, XmlBlasterUnmanagedCEException::remote, and strcpyAlloc().
Here is the call graph for this function:

IMAGE
void freeXmlBlasterAccessUnparsedUnmanagedCE (XmlBlasterAccessUnparsed * xmlBlasterAccess)

Definition at line 293 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, and freeXmlBlasterAccessUnparsed().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsedUnmanagedCE (int argc, char ** argv)

Definition at line 278 of file XmlBlasterUnmanagedCE.c.
References getXmlBlasterAccessUnparsed(), and strcpyAlloc().
Here is the call graph for this function:

IMAGE
char* getXmlBlasterEmei ()
You need to add cellcore.lib for compilation (WINCE). 

TODO: Not yet tested: What is inside the lineGeneralInfo.dwSerialNumberOffset?? TODO: Needs security model? 
Returns:
malloced string with IMEI, you need to free it 

Definition at line 572 of file XmlBlasterUnmanagedCE.c.static int interceptUpdate (MsgUnitArr * msgUnitArr, void * userData, XmlBlasterException * exception) [static]
We intercept the callbacks here and convert it to a more simple form to be easy transferable to C# (Csharp). 

Definition at line 211 of file XmlBlasterUnmanagedCE.c.
References ExceptionStruct::errorCode, XmlBlasterUnmanagedCEException::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, MsgUnitStructArr::isOneway, MsgUnitStructArr::len, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, XmlBlasterUnmanagedCEException::message, MsgUnitStructArr::msgUnitArr, ExceptionStruct::remote, XmlBlasterUnmanagedCEException::remote, MsgUnit::responseQos, MsgUnitStructArr::secretSessionId, strcpyAlloc(), strncpy0(), XmlBlasterAccessUnparsed::userFp, XMLBLASTER_C_bool, XMLBLASTER_LOG_TRACE, XMLBLASTER_LOG_WARN, and xmlBlasterUnmanagedCEExceptionFree().
Here is the call graph for this function:

IMAGE
static void myLogger (void * logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char * location, char * fmt,  ...) [static]

Definition at line 38 of file XmlBlasterUnmanagedCE.c.
References VSNPRINTF.
Referenced by main(), and xmlBlasterUnmanagedCERegisterLogger().char* xmlBlasterUnmanagedCEConnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException * exception)
Your qos is freed. 

Definition at line 316 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::connect, convert(), freeIt, interceptUpdate(), XmlBlasterAccessUnparsed::userFp, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEDisconnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEException * exception)
Your qos is freed. 

Definition at line 332 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::disconnect, freeIt, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEErase (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, XmlBlasterUnmanagedCEStringArr ** ppStruct)

Definition at line 417 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeIt, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedCEStringArr::str, strcpyAlloc(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEExceptionFree (XmlBlasterUnmanagedCEException * ex)

Definition at line 197 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterUnmanagedCEException::errorCode, XmlBlasterUnmanagedCEException::message, XmlBlasterUnmanagedCEException::remote, and xmlBlasterFree().
Referenced by interceptUpdate().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEFree (char * p)
Frees the malloced pointer. 

Parameters:
p Can be null 

Definition at line 160 of file XmlBlasterUnmanagedCE.c.
References xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEFreePP (char ** pp)
Frees the content of the malloced pointer It is a hack as i don't know how to free the IntPtr which arrived as ** and was allocated on (*ppStruct) for example in unSubscribe(): So we call this function similar as the unSubscribe() . 

.. 
Parameters:
pp Can be null 

Definition at line 172 of file XmlBlasterUnmanagedCE.c.
References xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEGet (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, MsgUnitUnmanagedCEget ** ppStruct)

Definition at line 450 of file XmlBlasterUnmanagedCE.c.
References MsgUnit::content, MsgUnit::contentLen, convert(), ExceptionStruct::errorCode, freeIt, freeMsgUnitArr(), XmlBlasterAccessUnparsed::get, MsgUnit::key, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, MsgUnit::responseQos, strcpyAlloc(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEInitialize (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException * exception)

Definition at line 303 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::initialize, interceptUpdate(), and XmlBlasterAccessUnparsed::userFp.
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEIsConnected (struct XmlBlasterAccessUnparsed * xa)

Definition at line 511 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::isConnected.char* xmlBlasterUnmanagedCEMalloc (int32_t size)
malloc size bytes 

Parameters:
size > 0 
Returns:
p the allocated pointer 

Definition at line 149 of file XmlBlasterUnmanagedCE.c.char* xmlBlasterUnmanagedCEPing (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEException * exception)

Definition at line 503 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, XmlBlasterAccessUnparsed::ping, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCEPublish (struct XmlBlasterAccessUnparsed * xa, MsgUnitUnmanagedCEpublish * msgUnitUnmanaged, XmlBlasterUnmanagedCEException * exception)

Definition at line 341 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, freeMsgUnitData(), and XmlBlasterAccessUnparsed::publish.
Here is the call graph for this function:

IMAGE
QosArr* xmlBlasterUnmanagedCEPublishArr (struct XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterUnmanagedCEException * exception)

Definition at line 350 of file XmlBlasterUnmanagedCE.c.
References convert(), and XmlBlasterAccessUnparsed::publishArr.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEPublishOneway (struct XmlBlasterAccessUnparsed * xa, void * msgUnitArr, int length, XmlBlasterUnmanagedCEException * exception)

Definition at line 357 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, freeMsgUnitData(), MsgUnitStructArr::isOneway, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, XmlBlasterAccessUnparsed::publishOneway, and MsgUnitStructArr::secretSessionId.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCERegisterLogger (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCELoggerFp logger)

Definition at line 91 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, and myLogger().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCERegisterProgressListener (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCECallbackProgressListenerFp csharpProgressListenerFp)
Called by managed C# code to register for progress notifications. 

Definition at line 128 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::callbackP, callbackProgressListener(), XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, and CallbackServerUnparsedStruct::readFromSocket.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCESubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception)
Your key and qos is freed. 

Definition at line 379 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, XmlBlasterAccessUnparsed::subscribe, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEUnSubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, XmlBlasterUnmanagedCEStringArr ** ppStruct)

Definition at line 388 of file XmlBlasterUnmanagedCE.c.
References convert(), ExceptionStruct::errorCode, freeIt, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedCEStringArr::str, strcpyAlloc(), XmlBlasterAccessUnparsed::unSubscribe, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCEUsage ()

Definition at line 515 of file XmlBlasterUnmanagedCE.c.
References XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCEVersion ()

Definition at line 520 of file XmlBlasterUnmanagedCE.c.
References getXmlBlasterVersion(), and strcpyAlloc().
Here is the call graph for this function:

IMAGE

Variable Documentation
int freeIt = 1 [static]

Definition at line 25 of file XmlBlasterUnmanagedCE.c.
Referenced by xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEDisconnect(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEPing(), xmlBlasterUnmanagedCEPublish(), xmlBlasterUnmanagedCEPublishOneway(), xmlBlasterUnmanagedCESubscribe(), and xmlBlasterUnmanagedCEUnSubscribe().

socket/xmlBlasterZlib.c File Reference
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <socket/xmlBlasterZlib.h>
#include <socket/xmlBlasterSocket.h>

Include dependency graph for xmlBlasterZlib.c:

IMAGE

Functions
static void dumpZlib (char *p, XmlBlasterZlibReadBuffers *zlibReadBufP, XmlBlasterZlibWriteBuffers *zlibWriteBufP)
Helper for debugging. 

int xmlBlaster_initZlibWriter (XmlBlasterZlibWriteBuffers *zlibWriteBufP)
Call only once for a socket connection stream. 

ssize_t xmlBlaster_writenCompressed (XmlBlasterZlibWriteBuffers *zlibWriteBufP, int fd, char *ptr, size_t nbytes)
Compress given bytes with zlib and write them to the socket. 

int xmlBlaster_endZlibWriter (XmlBlasterZlibWriteBuffers *zlibWriteBufP)

See also:
xmlBlasterZlib.h 

int xmlBlaster_initZlibReader (XmlBlasterZlibReadBuffers *zlibReadBufP)
Call only once for a socket connection stream. 

ssize_t xmlBlaster_readnCompressed (XmlBlasterZlibReadBuffers *zlibReadBufP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Read compressed data from the socket and uncompress it. 

int xmlBlaster_endZlibReader (XmlBlasterZlibReadBuffers *zlibReadBufP)
Cleanup after socket is closed. 

Function Documentation
static void dumpZlib (char * p, XmlBlasterZlibReadBuffers * zlibReadBufP, XmlBlasterZlibWriteBuffers * zlibWriteBufP) [static]
Helper for debugging. 

Definition at line 48 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, XmlBlasterZlibReadBuffers::c_stream, XmlBlasterZlibReadBuffers::compBuffer, XmlBlasterZlibReadBuffers::currCompBufferP, and XmlBlasterZlibReadBuffers::currCompBytes.
Referenced by xmlBlaster_endZlibWriter(), xmlBlaster_readnCompressed(), and xmlBlaster_writenCompressed().int xmlBlaster_endZlibReader (XmlBlasterZlibReadBuffers * zlibReadBufP)
Cleanup after socket is closed. 

Parameters:
zlibReadBufP Struct holding necessary variables to use zlib 

Definition at line 281 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream.
Referenced by freeXmlBlasterConnectionUnparsed().int xmlBlaster_endZlibWriter (XmlBlasterZlibWriteBuffers * zlibWriteBufP)

See also:
xmlBlasterZlib.h 

Definition at line 149 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, XmlBlasterZlibWriteBuffers::debug, and dumpZlib().
Referenced by freeXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
int xmlBlaster_initZlibReader (XmlBlasterZlibReadBuffers * zlibReadBufP)
Call only once for a socket connection stream. 

Returns:
Z_OK==0 or error from inflateInit() 

Definition at line 166 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream, XmlBlasterZlibReadBuffers::compBuffer, XmlBlasterZlibReadBuffers::currCompBufferP, XmlBlasterZlibReadBuffers::currCompBytes, and XmlBlasterZlibReadBuffers::debug.
Referenced by initConnection().int xmlBlaster_initZlibWriter (XmlBlasterZlibWriteBuffers * zlibWriteBufP)
Call only once for a socket connection stream. 

Returns:
Z_OK==0 or error from deflateInit() 

Definition at line 68 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, and XmlBlasterZlibWriteBuffers::debug.
Referenced by initConnection().ssize_t xmlBlaster_readnCompressed (XmlBlasterZlibReadBuffers * zlibReadBufP, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2)
Read compressed data from the socket and uncompress it. 

Parameters:
zlibReadBufP Struct holding necessary variables to use zlib 
fd The socket descriptor 
ptr The empty buffer which gets filled with raw bytes from socket (out parameter) 
nbytes The max. size of 'ptr' 
Returns:
number of bytes read, -1 is EOF 

Definition at line 193 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream, XmlBlasterZlibReadBuffers::compBuffer, XmlBlasterZlibReadBuffers::currCompBufferP, XmlBlasterZlibReadBuffers::currCompBytes, XmlBlasterZlibReadBuffers::debug, dumpZlib(), and XMLBLASTER_ZLIB_READ_COMPBUFFER_LEN.
Referenced by readnCompressed().
Here is the call graph for this function:

IMAGE
ssize_t xmlBlaster_writenCompressed (XmlBlasterZlibWriteBuffers * zlibWriteBufP, int fd, char * ptr, size_tnbytes)
Compress given bytes with zlib and write them to the socket. 

Parameters:
fd The socket descriptor 
ptr The buffer with raw bytes 
nbytes The number of bytes in 'ptr' 
Returns:
Number of bytes written 

Definition at line 92 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, XmlBlasterZlibWriteBuffers::compBuffer, XmlBlasterZlibWriteBuffers::debug, dumpZlib(), writen(), and XMLBLASTER_ZLIB_WRITE_COMPBUFFER_LEN.
Referenced by writenCompressed().
Here is the call graph for this function:

IMAGE

socket/xmlBlasterZlib.h File Reference
#include <util/basicDefs.h>
#include <zlib.h>

Include dependency graph for xmlBlasterZlib.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterZlibWriteBuffers
Helper struct to compress a byte buffer before putting it into the socket. 

struct XmlBlasterZlibReadBuffers
Helper struct to uncompress a byte buffer coming from the socket connection. 

Defines
#define XMLBLASTER_ZLIB_WRITE_COMPBUFFER_LEN  20000
#define XMLBLASTER_ZLIB_READ_COMPBUFFER_LEN  20000
Functions
int xmlBlaster_initZlibWriter (XmlBlasterZlibWriteBuffers *zlibWriteBufP)
Call only once for a socket connection stream. 

ssize_t xmlBlaster_writenCompressed (XmlBlasterZlibWriteBuffers *zlibWriteBufP, int fd, char *ptr, size_tnbytes)
Compress given bytes with zlib and write them to the socket. 

int xmlBlaster_endZlibWriter (XmlBlasterZlibWriteBuffers *zlibWriteBufP)

See also:
xmlBlasterZlib.h 

int xmlBlaster_initZlibReader (XmlBlasterZlibReadBuffers *zlibReadBufP)
Call only once for a socket connection stream. 

ssize_t xmlBlaster_readnCompressed (XmlBlasterZlibReadBuffers *zlibReadBufP, int fd, char *ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Read compressed data from the socket and uncompress it. 

int xmlBlaster_endZlibReader (XmlBlasterZlibReadBuffers *zlibReadBufP)
Cleanup after socket is closed. 

Define Documentation
#define XMLBLASTER_ZLIB_READ_COMPBUFFER_LEN  20000

Definition at line 43 of file xmlBlasterZlib.h.
Referenced by xmlBlaster_readnCompressed().#define XMLBLASTER_ZLIB_WRITE_COMPBUFFER_LEN  20000

Definition at line 23 of file xmlBlasterZlib.h.
Referenced by xmlBlaster_writenCompressed().
Function Documentation
int xmlBlaster_endZlibReader (XmlBlasterZlibReadBuffers * zlibReadBufP)
Cleanup after socket is closed. 

Parameters:
zlibReadBufP Struct holding necessary variables to use zlib 

Definition at line 281 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream.
Referenced by freeXmlBlasterConnectionUnparsed().int xmlBlaster_endZlibWriter (XmlBlasterZlibWriteBuffers * zlibWriteBufP)

See also:
xmlBlasterZlib.h 

Definition at line 149 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, XmlBlasterZlibWriteBuffers::debug, and dumpZlib().
Referenced by freeXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
int xmlBlaster_initZlibReader (XmlBlasterZlibReadBuffers * zlibReadBufP)
Call only once for a socket connection stream. 

Returns:
Z_OK==0 or error from inflateInit() 

Definition at line 166 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream, XmlBlasterZlibReadBuffers::compBuffer, XmlBlasterZlibReadBuffers::currCompBufferP, XmlBlasterZlibReadBuffers::currCompBytes, and XmlBlasterZlibReadBuffers::debug.
Referenced by initConnection().int xmlBlaster_initZlibWriter (XmlBlasterZlibWriteBuffers * zlibWriteBufP)
Call only once for a socket connection stream. 

Returns:
Z_OK==0 or error from deflateInit() 

Definition at line 68 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, and XmlBlasterZlibWriteBuffers::debug.
Referenced by initConnection().ssize_t xmlBlaster_readnCompressed (XmlBlasterZlibReadBuffers * zlibReadBufP, int fd, char * ptr, size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void * userP2)
Read compressed data from the socket and uncompress it. 

Parameters:
zlibReadBufP Struct holding necessary variables to use zlib 
fd The socket descriptor 
ptr The empty buffer which gets filled with raw bytes from socket (out parameter) 
nbytes The max. size of 'ptr' 
Returns:
number of bytes read, -1 is EOF 

Definition at line 193 of file xmlBlasterZlib.c.
References XmlBlasterZlibReadBuffers::c_stream, XmlBlasterZlibReadBuffers::compBuffer, XmlBlasterZlibReadBuffers::currCompBufferP, XmlBlasterZlibReadBuffers::currCompBytes, XmlBlasterZlibReadBuffers::debug, dumpZlib(), and XMLBLASTER_ZLIB_READ_COMPBUFFER_LEN.
Referenced by readnCompressed().
Here is the call graph for this function:

IMAGE
ssize_t xmlBlaster_writenCompressed (XmlBlasterZlibWriteBuffers * zlibWriteBufP, int fd, char * ptr, size_tnbytes)
Compress given bytes with zlib and write them to the socket. 

Parameters:
fd The socket descriptor 
ptr The buffer with raw bytes 
nbytes The number of bytes in 'ptr' 
Returns:
Number of bytes written 

Definition at line 92 of file xmlBlasterZlib.c.
References XmlBlasterZlibWriteBuffers::c_stream, XmlBlasterZlibWriteBuffers::compBuffer, XmlBlasterZlibWriteBuffers::debug, dumpZlib(), writen(), and XMLBLASTER_ZLIB_WRITE_COMPBUFFER_LEN.
Referenced by writenCompressed().
Here is the call graph for this function:

IMAGE

util/basicDefs.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>

Include dependency graph for basicDefs.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Defines
#define Dll_Export
#define bool  int
#define true  1
#define false  0
#define XMLBLASTER_C_bool  bool
#define SNPRINTF  snprintf
#define VSNPRINTF  vsnprintf
#define PRINTF_PREFIX_INT64_T  "%lld"
#define PRINTF_PREFIX_UINT64_T  "%llu"
#define INT64_STRLEN_MAX  22
Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL Set -DGCC_ANSI on command line if you use the 'gcc --ansi' flag. 

#define _INLINE_FUNC  inline
#define XB_USE_PTHREADS  1
Used to dump thread ID in default logging output, undef it if you run single threaded. 

Typedefs
typedef void(*) XmlBlasterNumReadFunc (void *xb, const size_t currBytesRead, const size_t nbytes)
Declare function callback pointer about how many bytes are read from socket. 

Define Documentation
#define _INLINE_FUNC  inline

Definition at line 133 of file basicDefs.h.#define bool  int

Definition at line 50 of file basicDefs.h.#define Dll_Export

Definition at line 42 of file basicDefs.h.#define false  0

Definition at line 52 of file basicDefs.h.#define INT64_STRLEN_MAX  22
Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL Set -DGCC_ANSI on command line if you use the 'gcc --ansi' flag. 

Definition at line 116 of file basicDefs.h.
Referenced by int64ToStr(), persistentQueuePut(), and persistentQueueRandomRemove().#define PRINTF_PREFIX_INT64_T  "%lld"

Definition at line 110 of file basicDefs.h.
Referenced by int64ToStr(), and strToInt64().#define PRINTF_PREFIX_UINT64_T  "%llu"

Definition at line 111 of file basicDefs.h.#define SNPRINTF  snprintf

Definition at line 73 of file basicDefs.h.
Referenced by checkArgs(), compilePreparedQuery(), createCallbackServer(), createTables(), embedException(), encodeMsgUnit(), execSilent(), fillCache(), getExceptionStr(), handleMessage(), initConnection(), initialize(), interceptUpdate(), messageUnitToXmlLimited(), mutexUnlock(), parseCacheInfo(), parseQueueEntryArr(), persistentQueueClear(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), postSendEvent(), preSendEvent(), queueEntryToXml(), sendData(), xmlBlasterAccessUnparsedUsage(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().#define true  1

Definition at line 51 of file basicDefs.h.#define VSNPRINTF  vsnprintf

Definition at line 74 of file basicDefs.h.
Referenced by myLogger().#define XB_USE_PTHREADS  1
Used to dump thread ID in default logging output, undef it if you run single threaded. 

Definition at line 147 of file basicDefs.h.#define XMLBLASTER_C_bool  bool

Definition at line 54 of file basicDefs.h.
Referenced by interceptUpdate().
Typedef Documentation
typedef void( * ) XmlBlasterNumReadFunc(void *xb, const size_t currBytesRead, const size_t nbytes)
Declare function callback pointer about how many bytes are read from socket. 

Parameters:
userP A user pointer 
currBytesRead The currently number of bytes read 
nbytes Totally expected bytes 

Definition at line 156 of file basicDefs.h.

util/helper.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <time.h>
#include "helper.h"
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <pthread.h>
#include <wchar.h>

Include dependency graph for helper.c:

IMAGE

Defines
#define MICRO_SECS_PER_SECOND  1000000
#define NANO_SECS_PER_SECOND  MICRO_SECS_PER_SECOND * 1000
#define ESC  "\033[0m";
#define BOLD  "\033[1m"
#define RED_BLACK  "\033[31;40m"
#define GREEN_BLACK  "\033[32;40m"
#define YELLOW_BLACK  "\033[33;40m"
#define BLUE_BLACK  "\033[34;40m"
#define PINK_BLACK  "\033[35;40m"
#define LTGREEN_BLACK  "\033[36;40m"
#define WHITE_BLACK  "\033[37;40m"
#define WHITE_RED  "\033[37;41m"
#define BLACK_RED  "\033[30;41m"
#define BLACK_GREEN  "\033[40;42m"
#define BLACK_PINK  "\033[40;45m"
#define BLACK_LTGREEN  "\033[40;46m"
#define XMLBLASTER_SLEEP_FALLBACK  0
#define XMLBLASTER_SLEEP_NANO  0
Functions
static int vsnprintf0 (char *s, size_t size, char *format, va_list ap)
char * getStackTrace (int maxNumOfLines)
Add for GCC compilation: "-rdynamic -export-dynamic -D_ENABLE_STACK_TRACE_". 

void sleepMillis (long millisecs)
Sleep for given milliseconds, on none real time systems expect ~ 10 millisecs tolerance. 

int64_t getTimestamp ()
Create a timestamp in nano seconds elapsed since 1970-01-01. 

char ** convertWcsArgv (wchar_t **argv_wcs, int argc)
Converts the given wide char pwcs to multibyte argv. 

void freeArgv (char **argv, int argc)
Frees the allocated argv from convertWcsArgv(). 

int getAbsoluteTime (long relativeTimeFromNow, struct timespec *abstime)
Fills the given abstime with absolute time, using the given timeout relativeTimeFromNow in milliseconds On Linux < 2.5.64 does not support high resolution timers clock_gettime(), but patches are available at http://sourceforge.net/projects/high-res-timers. 

char * strcpyAlloc (char *src)
Allocates the string with malloc for you. 

char * strcatAlloc (char **dest, char *src)
Same as strcat but reallocs the 'dest' string. 

char * strcpyRealloc (char **dest, char *src)
Same as strcpyAlloc but if the given *dest != NULL this old allocation is freed first. 

char * strFromBlobAlloc (char *blob, size_t len)
Allocates the string with malloc for you, it is always ended with 0. 

void xb_strerror (char *errnoStr, size_t sizeInBytes, int errnum)
Convert the errnum to a human readable errnoStr. 

char * strncpy0 (char *to, char *from, size_t maxLen)
Guarantees a 0 terminated string. 

char * strncat0 (char *to, char *from, size_t max)
Guarantees a 0 terminated string. 

int snprintf0 (char *buffer, size_t sizeOfBuffer, char *format,...)
Microsoft introduces the vsnprintf_s(). 

void trim (char *s)
strip leading and trailing spaces of the given string 

void trimStart (char *s)
strip leading spaces of the given string 

void trimEnd (char *s)
strip trailing spaces of the given string 

char * toReadableDump (char *data, size_t len)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

long get_pthread_id (pthread_t t)
Cast the thread identifier to an long value. 

void getCurrentTimeStr (char *timeStr, int bufSize)
Get a human readable time string for logging. 

void xmlBlasterDefaultLogging (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char *location, char *fmt,...)
Default logging output is handled by this method: All logging is appended a time, the loglevel and the location string. 

XMLBLASTER_LOG_LEVEL parseLogLevel (char *logLevelStr)
Parses the given string and returns the enum for it. 

char * getLogLevelStr (XMLBLASTER_LOG_LEVEL logLevel)

Returns:
A human readable log level, e.g. 

int doLog (XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level)
Check if logging is necessary. 

void embedException (ExceptionStruct *exception, char *newErrorCode, char *newMessage, ExceptionStruct *embed)
Embed the given 'embed' into exception->message. 

void initializeExceptionStruct (ExceptionStruct *exception)
Should be called on any ExceptionStruct before using it. 

char * getExceptionStr (char *out, int outSize, ExceptionStruct *exception)
Convenience function which returns a formatted exception string. 

char * int64ToStr (char *buf, int64_t val)
Convert a 64 bit integer to a string. 

int strToInt64 (int64_t *val, char *str)
Convert a string to a 64 bit integer. 

int strToLong (long *val, char *str)
int strToInt (int *val, char *str)
int strToULong (unsigned long *val, char *str)
BlobHolder * blobcpyAlloc (BlobHolder *blob, char *data, size_t dataLen)
Allocates the string with malloc for you. 

BlobHolder * freeBlobHolderContent (BlobHolder *blob)
free()'s the data in the given blob, does not free the blob itself. 

char * blobDump (BlobHolder *blob)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

void freeBlobDump (char *blobDump)
Variables
static char * LOG_TEXT [] = { "NOLOG", "ERROR", "WARN", "INFO", "CALL", "TIME", "TRACE", "DUMP", "PLAIN" }
static int numLOG_TEXT = 9
static char * LOG_TEXT_ESCAPE []

Define Documentation
#define BLACK_GREEN  "\033[40;42m"

Definition at line 70 of file helper.c.#define BLACK_LTGREEN  "\033[40;46m"

Definition at line 72 of file helper.c.#define BLACK_PINK  "\033[40;45m"

Definition at line 71 of file helper.c.#define BLACK_RED  "\033[30;41m"

Definition at line 69 of file helper.c.#define BLUE_BLACK  "\033[34;40m"

Definition at line 63 of file helper.c.#define BOLD  "\033[1m"

Definition at line 58 of file helper.c.#define ESC  "\033[0m";

Definition at line 57 of file helper.c.#define GREEN_BLACK  "\033[32;40m"

Definition at line 61 of file helper.c.#define LTGREEN_BLACK  "\033[36;40m"

Definition at line 65 of file helper.c.#define MICRO_SECS_PER_SECOND  1000000

Definition at line 51 of file helper.c.#define NANO_SECS_PER_SECOND  MICRO_SECS_PER_SECOND * 1000

Definition at line 52 of file helper.c.
Referenced by getAbsoluteTime(), and getTimestamp().#define PINK_BLACK  "\033[35;40m"

Definition at line 64 of file helper.c.#define RED_BLACK  "\033[31;40m"

Definition at line 60 of file helper.c.#define WHITE_BLACK  "\033[37;40m"

Definition at line 66 of file helper.c.#define WHITE_RED  "\033[37;41m"

Definition at line 68 of file helper.c.#define XMLBLASTER_SLEEP_FALLBACK  0

Definition at line 141 of file helper.c.#define XMLBLASTER_SLEEP_NANO  0

Definition at line 144 of file helper.c.#define YELLOW_BLACK  "\033[33;40m"

Definition at line 62 of file helper.c.
Function Documentation
BlobHolder* blobcpyAlloc (BlobHolder * blob, char * data, size_t dataLen)
Allocates the string with malloc for you. 

You need to free it with free() 
Parameters:
blob If null it is malloc()'d for you, else the given blob is used to be filled. 
Returns:
The given blob (or a new malloc()'d if blob was NULL), the data is 0 terminated. We return NULL on out of memory. 

Definition at line 945 of file helper.c.
References BlobHolder::data, and BlobHolder::dataLen.
Referenced by responseEvent(), and sendData().char* blobDump (BlobHolder * blob)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

Parameters:
blob The binary data 
Returns:
readable is returned, it must be free()'d 

Definition at line 984 of file helper.c.
References BlobHolder::data, BlobHolder::dataLen, and toReadableDump().
Referenced by sendData().
Here is the call graph for this function:

IMAGE
char** convertWcsArgv (wchar_t ** argv_wcs, int argc)
Converts the given wide char pwcs to multibyte argv. 

Call freeWcsArgv() to free the memory again. 
Parameters:
pwcs In parameter: Wide char command line arguments 
argc The number of strings in pwcs 
Returns:
argv Is allocated with malloc and holds all given pwcs strings 

Definition at line 224 of file helper.c.
References argv.int doLog (XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level)
Check if logging is necessary. 

Parameters:
currLevel The actual log level of the client 
level The level of this log entry 
Returns:
true If logging is desired 

Definition at line 811 of file helper.c.void embedException (ExceptionStruct * exception, char * newErrorCode, char * newMessage, ExceptionStruct * embed)
Embed the given 'embed' into exception->message. 

embed  and exception  may point on the same instance 
Parameters:
embed An original exception to embed, can be empty in which case it is ignored 
exception Contains the new exception with embedded old exception errorCode/message 

Definition at line 822 of file helper.c.
References ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getExceptionStr(), ExceptionStruct::message, SNPRINTF, and strncpy0().
Referenced by createQueue(), and xmlBlasterInitQueue().
Here is the call graph for this function:

IMAGE
void freeArgv (char ** argv, int argc)
Frees the allocated argv from convertWcsArgv(). 

Parameters:
argv The main(argv) 
argc The number of strings in argv 

Definition at line 249 of file helper.c.
Referenced by main().void freeBlobDump (char * blobDump)

Definition at line 989 of file helper.c.
Referenced by sendData().BlobHolder* freeBlobHolderContent (BlobHolder * blob)
free()'s the data in the given blob, does not free the blob itself. 

Parameters:
blob if NULL we return NULL 
Returns:
The given blob 

Definition at line 967 of file helper.c.
References BlobHolder::data, and BlobHolder::dataLen.
Referenced by handleMessage(), postSendEvent(), sendData(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().long get_pthread_id (pthread_t t)
Cast the thread identifier to an long value. 

Parameters:
t The pthread_t type 
Returns:
A uniquue long, usually the pointer address 

Definition at line 648 of file helper.c.
Referenced by freeXmlBlasterAccessUnparsed(), interceptUpdate(), runUpdate(), and xmlBlasterDefaultLogging().int getAbsoluteTime (long relativeTimeFromNow, struct timespec * abstime)
Fills the given abstime with absolute time, using the given timeout relativeTimeFromNow in milliseconds On Linux < 2.5.64 does not support high resolution timers clock_gettime(), but patches are available at http://sourceforge.net/projects/high-res-timers. 

Parameters:
relativeTimeFromNow the relative time from now in milliseconds 
abstime 
Returns:
true If implemented 

Definition at line 266 of file helper.c.
References NANO_SECS_PER_SECOND.
Referenced by getTimestamp(), and postSendEvent().void getCurrentTimeStr (char * timeStr, int bufSize)
Get a human readable time string for logging. 

Parameters:
timeStr out parameter, e.g. "2006-11-14 12:34:46" 
bufSize The size of timeStr 

Definition at line 663 of file helper.c.
References snprintf0(), and strncpy0().
Referenced by xmlBlasterDefaultLogging().
Here is the call graph for this function:

IMAGE
char* getExceptionStr (char * out, int outSize, ExceptionStruct * exception)
Convenience function which returns a formatted exception string. 

 
 
Parameters:
out The string where the exception is written into, you should allocate at least EXCEPTIONSTRUCT_ERRORCODE_LEN + EXCEPTIONSTRUCT_MESSAGE_LEN + 64 bytes for it 
outSize The max size of 'out' 
exception The exception to dump 
Returns:
out 

Definition at line 861 of file helper.c.
References ExceptionStruct::errorCode, ExceptionStruct::message, and SNPRINTF.
Referenced by destroy(), and embedException().char* getLogLevelStr (XMLBLASTER_LOG_LEVEL logLevel)

Returns:
A human readable log level, e.g. 

"ERROR" 

Definition at line 800 of file helper.c.
References LOG_TEXT.
Referenced by getXmlBlasterAccessUnparsed(), and myLogger().char* getStackTrace (int maxNumOfLines)
Add for GCC compilation: "-rdynamic -export-dynamic -D_ENABLE_STACK_TRACE_". 

Returns:
The stack trace, you need to free() it. Returns NULL if out of memory. 

Definition at line 94 of file helper.c.
References strcatAlloc(), and strcpyAlloc().
Referenced by checkArgs(), freeXmlBlasterAccessUnparsed(), and xmlBlasterDefaultLogging().
Here is the call graph for this function:

IMAGE
int64_t getTimestamp (void)
Create a timestamp in nano seconds elapsed since 1970-01-01. 

The timestamp is guaranteed to be ascending and unique. 

Definition at line 199 of file helper.c.
References getAbsoluteTime(), and NANO_SECS_PER_SECOND.
Referenced by myUpdate().
Here is the call graph for this function:

IMAGE
void initializeExceptionStruct (ExceptionStruct * exception)
Should be called on any ExceptionStruct before using it. 

Nulls all fields 

Definition at line 843 of file helper.c.
References ExceptionStruct::errorCode, ExceptionStruct::message, and ExceptionStruct::remote.
Referenced by checkArgs().char* int64ToStr (char * buf, int64_t val)
Convert a 64 bit integer to a string. 

This helper concentrates this conversion to one place to simplify porting to compilers with no int64_t = long long  support 
Parameters:
buf You need to pass this buffer with at least INT64_STRLEN_MAX=22 bytes of size 
Returns:
buf 

< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL 

Definition at line 874 of file helper.c.
References INT64_STRLEN_MAX, PRINTF_PREFIX_INT64_T, and snprintf0().
Referenced by fillCache(), parseQueueEntryArr(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), queueEntryToXml(), test_overflow(), and test_queue().
Here is the call graph for this function:

IMAGE
XMLBLASTER_LOG_LEVEL parseLogLevel (char * logLevelStr)
Parses the given string and returns the enum for it. 

If logLevelStr is NULL or empty or unknown we return the default log level. 
Parameters:
logLevelStr The level e.g. "WARN" or "warn" or "2" 
Returns:
The enum, e.g. XMLBLASTER_LOG_WARN 

Definition at line 776 of file helper.c.
References LOG_TEXT, numLOG_TEXT, strToInt(), and XMLBLASTER_LOG_WARN.
Referenced by getCallbackServerUnparsed(), getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
void sleepMillis (long millisecs)
Sleep for given milliseconds, on none real time systems expect ~ 10 millisecs tolerance. 

Definition at line 150 of file helper.c.
Referenced by compilePreparedQuery(), freeXmlBlasterAccessUnparsed(), getResultRows(), main(), and myUpdate().int snprintf0 (char * buffer, size_t sizeOfBuffer, char * format,  ...)
Microsoft introduces the vsnprintf_s(). 

Definition at line 524 of file helper.c.
References vsnprintf0().
Referenced by encodeMsgUnitArr(), encodeSocketMessage(), getCurrentTimeStr(), int64ToStr(), parseSocketData(), xb_strerror(), and xmlBlasterConnect().
Here is the call graph for this function:

IMAGE
char* strcatAlloc (char ** dest, char * src)
Same as strcat but reallocs the 'dest' string. 

Returns:
The allocated string (*dest) or NULL if out of memory 

Definition at line 379 of file helper.c.
References strncat0().
Referenced by getStackTrace(), and messageUnitToXmlLimited().
Here is the call graph for this function:

IMAGE
char* strcpyAlloc (char * src)
Allocates the string with malloc for you. 

You need to free it with free() 
Parameters:
src The text to copy 
Returns:
The allocated string or NULL if out of memory 

Definition at line 363 of file helper.c.
References strncpy0().
Referenced by convert(), getCallbackServerUnparsed(), getStackTrace(), getXmlBlasterAccessUnparsedUnmanaged(), getXmlBlasterAccessUnparsedUnmanagedCE(), interceptUpdate(), main(), messageUnitToXmlLimited(), myUpdate(), parseMsgUnitArr(), parseQosArr(), sendResponse(), strcpyRealloc(), xmlBlasterConnect(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedCEVersion(), xmlBlasterUnmanagedErase(), xmlBlasterUnmanagedGet(), and xmlBlasterUnmanagedUnSubscribe().
Here is the call graph for this function:

IMAGE
char* strcpyRealloc (char ** dest, char * src)
Same as strcpyAlloc but if the given *dest != NULL this old allocation is freed first. 

Returns:
*dest The allocated string filled with 'src', you need to free() it when not needed anymore. 

Definition at line 396 of file helper.c.
References strcpyAlloc().
Referenced by createCallbackServer(), and useThisSocket().
Here is the call graph for this function:

IMAGE
char* strFromBlobAlloc (char * blob, size_t len)
Allocates the string with malloc for you, it is always ended with 0. 

NOTE: If your given blob or len is 0 an empty string of size 1 is returned 
Returns:
The string, never null. You need to free it with free() 

Definition at line 410 of file helper.c.
Referenced by interceptUpdate(), main(), messageUnitToXmlLimited(), queueEntryToXml(), test_queue(), xmlBlasterConnect(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterSubscribe(), and xmlBlasterUnmanagedGet().char* strncat0 (char * to, char * from, size_t max)
Guarantees a 0 terminated string. 

Parameters:
to The destination string must be big enough 
from The source to be appended 
max Number of characters to append, max-1 will be ended by 0 
Returns:
The destination string 'to' 

Definition at line 491 of file helper.c.
Referenced by strcatAlloc(), xmlBlasterConnect(), and xmlBlasterConnectionUnparsedUsage().char* strncpy0 (char * to, char * from, size_t maxLen)
Guarantees a 0 terminated string. 

Parameters:
to The destination string must be big enough 
from The source to be copied 
maxLen (maxLen-1) of 'to' will be filled with a 0, so effectively only maxLen-1 from 'from' are copied. 
Returns:
The destination string 'to' 

Definition at line 461 of file helper.c.
Referenced by checkArgs(), compilePreparedQuery(), convertToXmlBlasterException(), destroy(), embedException(), execSilent(), getCurrentTimeStr(), handleMessage(), initConnection(), initialize(), interceptUpdate(), messageUnitToXmlLimited(), mutexUnlock(), myUpdate(), parseCacheInfo(), parseMsgUnitArr(), parseQueueEntryArr(), parseSocketData(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), postSendEvent(), preSendEvent(), sendData(), strcpyAlloc(), test_illegal(), test_overflow(), test_queue(), xb_strerror(), xmlBlasterConnect(), xmlBlasterConnectionUnparsedUsage(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().int strToInt (int * val, char * str)

Definition at line 915 of file helper.c.
References strToInt64().
Referenced by parseLogLevel().
Here is the call graph for this function:

IMAGE
int strToInt64 (int64_t * val, char * str)
Convert a string to a 64 bit integer. 

This helper concentrates this conversion to one place to simplify porting to compilers with no long long  support 
Parameters:
val Your long long  which is filled from str  
str The string to convert, for example "123450000LL" 
Returns:
true on success 

Definition at line 891 of file helper.c.
References PRINTF_PREFIX_INT64_T.
Referenced by getInt64(), parseCacheInfo(), parseQueueEntryArr(), strToInt(), and strToLong().int strToLong (long * val, char * str)

Definition at line 903 of file helper.c.
References strToInt64().
Referenced by getLong().
Here is the call graph for this function:

IMAGE
int strToULong (unsigned long * val, char * str)

Definition at line 927 of file helper.c.
Referenced by parseMsgUnitArr(), and parseSocketData().char* toReadableDump (char * data, size_t len)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

Parameters:
data The data to convert 
len The length of the binary data 
Returns:
readable is returned, it must be free()'d. If allocation fails NULL is returned 

Definition at line 623 of file helper.c.
Referenced by blobDump(), encodeSocketMessage(), and parseSocketData().void trim (char * s)
strip leading and trailing spaces of the given string 

Definition at line 540 of file helper.c.
Referenced by convertToXmlBlasterException(), parseMsgUnitArr(), and parseSocketData().void trimEnd (char * s)
strip trailing spaces of the given string 

Definition at line 604 of file helper.c.void trimStart (char * s)
strip leading spaces of the given string 

Definition at line 576 of file helper.c.int vsnprintf0 (char * s, size_t size, char * format, va_list ap) [static]

Definition at line 506 of file helper.c.
Referenced by snprintf0(), and xmlBlasterDefaultLogging().void xb_strerror (char * errnoStr, size_t sizeInBytes, int errnum)
Convert the errnum to a human readable errnoStr. 

Parameters:
errnoStr Out parameter holding the string 
sizeInBytes Size of the buffer 
errnum The error number (errno) 

Definition at line 437 of file helper.c.
References snprintf0(), and strncpy0().
Referenced by initConnection().
Here is the call graph for this function:

IMAGE
void xmlBlasterDefaultLogging (void * logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char * location, char * fmt,  ...)
Default logging output is handled by this method: All logging is appended a time, the loglevel and the location string. 

The logging output is to console. 
If you have your own logging device you need to implement this method yourself and register it with  
 xa->log = myXmlBlasterLoggingHandler; 
 
Parameters:
logUserP User specific location bounced back 
currLevel The actual log level of the client 
level The level of this log entry 
location A string describing the code place 
fmt The formatting string 
... Other variables to log, corresponds to 'fmt' 

Definition at line 710 of file helper.c.
References get_pthread_id(), getCurrentTimeStr(), getStackTrace(), LOG_TEXT, LOG_TEXT_ESCAPE, vsnprintf0(), and XMLBLASTER_LOG_ERROR.
Referenced by getCallbackServerUnparsed(), getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE

Variable Documentation
char* LOG_TEXT[] = { "NOLOG", "ERROR", "WARN", "INFO", "CALL", "TIME", "TRACE", "DUMP", "PLAIN" } [static]

Definition at line 54 of file helper.c.
Referenced by getLogLevelStr(), parseLogLevel(), and xmlBlasterDefaultLogging().char* LOG_TEXT_ESCAPE[] [static]
Initial value: {
       "NOLOG",
        "\033[31;40mERROR\033[0m",
        "\033[33;40mWARN\033[0m",
        "\033[32;40mINFO\033[0m",
        "\033[34;40mCALL\033[0m",
        "\033[36;40mTIME\033[0m",
        "\033[37;40mTRACE\033[0m",
        "\033[35;40mDUMP\033[0m",
        "\033[37;40mPLAIN\033[0m"
        }
Definition at line 75 of file helper.c.
Referenced by xmlBlasterDefaultLogging().int numLOG_TEXT = 9 [static]

Definition at line 55 of file helper.c.
Referenced by parseLogLevel().

util/helper.h File Reference
#include <util/basicDefs.h>
#include <pthread.h>

Include dependency graph for helper.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterReadFromSocketFuncHolder
Holds a callback function pointer and its user pointer (the 'this' pointer). 

struct XmlBlasterWriteToSocketFuncHolder
Holds a callback function pointer and its user pointer (the 'this' pointer, first argument). 

struct BlobHolder
Holds arbitrary raw data and its length. 

struct ExceptionStruct
Holds error text. 

Defines
#define XB_USE_PTHREADS  1
#define EXCEPTIONSTRUCT_ERRORCODE_LEN  56
#define EXCEPTIONSTRUCT_MESSAGE_LEN  1024
Typedefs
typedef ssize_t(*) XmlBlasterWriteToSocketFunc (void *xb, const int fd, const char *ptr, const size_t nbytes)
Declare function pointer to write to socket. 

typedef ssize_t(*) XmlBlasterReadFromSocketFunc (void *xb, const int fd, char *ptr, const size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Declare function pointer to read from socket. 

typedef enum XMLBLASTER_LOG_LEVEL_ENUM XMLBLASTER_LOG_LEVEL
typedef void(*) XmlBlasterLogging (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char *location, const char *fmt,...)
Enumerations
enum XMLBLASTER_LOG_LEVEL_ENUM { XMLBLASTER_LOG_ERROR = 1, XMLBLASTER_LOG_WARN = 2, XMLBLASTER_LOG_INFO = 3, XMLBLASTER_LOG_TRACE = 6, XMLBLASTER_LOG_DUMP = 7 }
Functions
void initializeExceptionStruct (ExceptionStruct *exception)
Should be called on any ExceptionStruct before using it. 

void embedException (ExceptionStruct *exception, const char *newErrorCode, const char *newMessage, const ExceptionStruct *embed)
const char * getExceptionStr (char *out, int outSize, const ExceptionStruct *exception)
void xmlBlasterDefaultLogging (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char *location, const char *fmt,...)
XMLBLASTER_LOG_LEVEL parseLogLevel (const char *logLevelStr)
const char * getLogLevelStr (XMLBLASTER_LOG_LEVEL logLevel)

Returns:
A human readable log level, e.g. 

int doLog (XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level)
Check if logging is necessary. 

char * getStackTrace (int maxNumOfLines)
Add for GCC compilation: "-rdynamic -export-dynamic -D_ENABLE_STACK_TRACE_". 

void sleepMillis (long millis)
Sleep for given milliseconds, on none real time systems expect ~ 10 millisecs tolerance. 

int64_t getTimestamp (void)
Create a timestamp in nano seconds elapsed since 1970-01-01. 

int getAbsoluteTime (long relativeTimeFromNow, struct timespec *abstime)
Fills the given abstime with absolute time, using the given timeout relativeTimeFromNow in milliseconds On Linux < 2.5.64 does not support high resolution timers clock_gettime(), but patches are available at http://sourceforge.net/projects/high-res-timers. 

void getCurrentTimeStr (char *timeStr, int bufSize)
Get a human readable time string for logging. 

char ** convertWcsArgv (wchar_t **argv_wcs, int argc)
Converts the given wide char pwcs to multibyte argv. 

void freeArgv (char **argv, int argc)
Frees the allocated argv from convertWcsArgv(). 

char * strFromBlobAlloc (const char *blob, const size_t len)
char * strcpyAlloc (const char *src)
char * strcpyRealloc (char **dest, const char *src)
char * strcatAlloc (char **dest, const char *src)
char * strncpy0 (char *const to, const char *const from, const size_t maxLen)
char * strncat0 (char *const to, const char *const from, const size_t max)
int snprintf0 (char *buffer, size_t sizeOfBuffer, const char *format,...)
void trim (char *s)
strip leading and trailing spaces of the given string 

void trimStart (char *s)
strip leading spaces of the given string 

void trimEnd (char *s)
strip trailing spaces of the given string 

void xb_strerror (char *errnoStr, size_t sizeInBytes, int errnum)
Convert the errnum to a human readable errnoStr. 

char * toReadableDump (char *data, size_t len)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

const char * int64ToStr (char *const buf, int64_t val)
Convert a 64 bit integer to a string. 

int strToInt64 (int64_t *val, const char *const str)
int strToLong (long *val, const char *const str)
int strToULong (unsigned long *val, const char *const str)
int strToInt (int *val, const char *const str)
BlobHolder * blobcpyAlloc (BlobHolder *blob, const char *data, size_t dataLen)
BlobHolder * freeBlobHolderContent (BlobHolder *blob)
free()'s the data in the given blob, does not free the blob itself. 

char * blobDump (BlobHolder *blob)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

void freeBlobDump (char *blobDump)
long get_pthread_id (pthread_t t)
Cast the thread identifier to an long value. 

Define Documentation
#define EXCEPTIONSTRUCT_ERRORCODE_LEN  56

Definition at line 80 of file helper.h.
Referenced by checkArgs(), compilePreparedQuery(), embedException(), execSilent(), interceptUpdate(), parseCacheInfo(), parseQueueEntryArr(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), and persistentQueuePut().#define EXCEPTIONSTRUCT_MESSAGE_LEN  1024

Definition at line 81 of file helper.h.
Referenced by checkArgs(), compilePreparedQuery(), createCallbackServer(), embedException(), execSilent(), interceptUpdate(), parseCacheInfo(), parseQueueEntryArr(), parseSocketData(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), and persistentQueuePut().#define XB_USE_PTHREADS  1

Definition at line 25 of file helper.h.
Typedef Documentation
typedef enum XMLBLASTER_LOG_LEVEL_ENUM  XMLBLASTER_LOG_LEVEL
typedef void( * ) XmlBlasterLogging(void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char *location, const char *fmt,...)

Definition at line 107 of file helper.h.typedef ssize_t( * ) XmlBlasterReadFromSocketFunc(void *xb, const int fd, char *ptr, const size_t nbytes, XmlBlasterNumReadFunc fpNumRead, void *userP2)
Declare function pointer to read from socket. 

Definition at line 37 of file helper.h.typedef ssize_t( * ) XmlBlasterWriteToSocketFunc(void *xb, const int fd, const char *ptr, const size_t nbytes)
Declare function pointer to write to socket. 

Definition at line 35 of file helper.h.
Enumeration Type Documentation
enum XMLBLASTER_LOG_LEVEL_ENUM

Enumerator: 
XMLBLASTER_LOG_ERROR  supported, use for programming errors 

XMLBLASTER_LOG_WARN  supported, use for user errors and wrong configurations 

XMLBLASTER_LOG_INFO  supported, use for success information only 

XMLBLASTER_LOG_TRACE  supported, use for debugging purposes 

XMLBLASTER_LOG_DUMP  supported, use for debugging purposes 

Definition at line 96 of file helper.h.
Function Documentation
BlobHolder* blobcpyAlloc (BlobHolder * blob, const char * data, size_t dataLen)
char* blobDump (BlobHolder * blob)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

Parameters:
blob The binary data 
Returns:
readable is returned, it must be free()'d 

Definition at line 984 of file helper.c.
References BlobHolder::data, BlobHolder::dataLen, and toReadableDump().
Referenced by sendData().
Here is the call graph for this function:

IMAGE
char** convertWcsArgv (wchar_t ** argv_wcs, int argc)
Converts the given wide char pwcs to multibyte argv. 

Call freeWcsArgv() to free the memory again. 
Parameters:
pwcs In parameter: Wide char command line arguments 
argc The number of strings in pwcs 
Returns:
argv Is allocated with malloc and holds all given pwcs strings 

Definition at line 224 of file helper.c.
References argv.int doLog (XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level)
Check if logging is necessary. 

Parameters:
currLevel The actual log level of the client 
level The level of this log entry 
Returns:
true If logging is desired 

Definition at line 811 of file helper.c.void embedException (ExceptionStruct * exception, const char * newErrorCode, const char * newMessage, const ExceptionStruct * embed)
void freeArgv (char ** argv, int argc)
Frees the allocated argv from convertWcsArgv(). 

Parameters:
argv The main(argv) 
argc The number of strings in argv 

Definition at line 249 of file helper.c.
Referenced by main().void freeBlobDump (char * blobDump)

Definition at line 989 of file helper.c.
Referenced by sendData().BlobHolder* freeBlobHolderContent (BlobHolder * blob)
free()'s the data in the given blob, does not free the blob itself. 

Parameters:
blob if NULL we return NULL 
Returns:
The given blob 

Definition at line 967 of file helper.c.
References BlobHolder::data, and BlobHolder::dataLen.
Referenced by handleMessage(), postSendEvent(), sendData(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().long get_pthread_id (pthread_t t)
Cast the thread identifier to an long value. 

Parameters:
t The pthread_t type 
Returns:
A uniquue long, usually the pointer address 

Definition at line 648 of file helper.c.
Referenced by freeXmlBlasterAccessUnparsed(), interceptUpdate(), runUpdate(), and xmlBlasterDefaultLogging().int getAbsoluteTime (long relativeTimeFromNow, struct timespec * abstime)
Fills the given abstime with absolute time, using the given timeout relativeTimeFromNow in milliseconds On Linux < 2.5.64 does not support high resolution timers clock_gettime(), but patches are available at http://sourceforge.net/projects/high-res-timers. 

Parameters:
relativeTimeFromNow the relative time from now in milliseconds 
abstime 
Returns:
true If implemented 

Definition at line 266 of file helper.c.
References NANO_SECS_PER_SECOND.
Referenced by getTimestamp(), and postSendEvent().void getCurrentTimeStr (char * timeStr, int bufSize)
Get a human readable time string for logging. 

Parameters:
timeStr out parameter, e.g. "2006-11-14 12:34:46" 
bufSize The size of timeStr 

Definition at line 663 of file helper.c.
References snprintf0(), and strncpy0().
Referenced by xmlBlasterDefaultLogging().
Here is the call graph for this function:

IMAGE
const char* getExceptionStr (char * out, int outSize, const ExceptionStruct * exception)
const char* getLogLevelStr (XMLBLASTER_LOG_LEVEL logLevel)

Returns:
A human readable log level, e.g. 

"ERROR" 

Definition at line 800 of file helper.c.
References LOG_TEXT.
Referenced by getXmlBlasterAccessUnparsed(), and myLogger().char* getStackTrace (int maxNumOfLines)
Add for GCC compilation: "-rdynamic -export-dynamic -D_ENABLE_STACK_TRACE_". 

Returns:
The stack trace, you need to free() it. Returns NULL if out of memory. 

Definition at line 94 of file helper.c.
References strcatAlloc(), and strcpyAlloc().
Referenced by checkArgs(), freeXmlBlasterAccessUnparsed(), and xmlBlasterDefaultLogging().
Here is the call graph for this function:

IMAGE
int64_t getTimestamp (void)
Create a timestamp in nano seconds elapsed since 1970-01-01. 

The timestamp is guaranteed to be ascending and unique. 

Definition at line 199 of file helper.c.
References getAbsoluteTime(), and NANO_SECS_PER_SECOND.
Referenced by myUpdate().
Here is the call graph for this function:

IMAGE
void initializeExceptionStruct (ExceptionStruct * exception)
Should be called on any ExceptionStruct before using it. 

Nulls all fields 

Definition at line 843 of file helper.c.
References ExceptionStruct::errorCode, ExceptionStruct::message, and ExceptionStruct::remote.
Referenced by checkArgs().const char* int64ToStr (char * buf, int64_t val)
Convert a 64 bit integer to a string. 

This helper concentrates this conversion to one place to simplify porting to compilers with no int64_t = long long  support 
Parameters:
buf You need to pass this buffer with at least INT64_STRLEN_MAX=22 bytes of size 
Returns:
buf 

< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL 

Definition at line 874 of file helper.c.
References INT64_STRLEN_MAX, PRINTF_PREFIX_INT64_T, and snprintf0().
Referenced by fillCache(), parseQueueEntryArr(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), queueEntryToXml(), test_overflow(), and test_queue().
Here is the call graph for this function:

IMAGE
XMLBLASTER_LOG_LEVEL parseLogLevel (const char * logLevelStr)
void sleepMillis (long millis)
Sleep for given milliseconds, on none real time systems expect ~ 10 millisecs tolerance. 

Definition at line 150 of file helper.c.
Referenced by compilePreparedQuery(), freeXmlBlasterAccessUnparsed(), getResultRows(), main(), and myUpdate().int snprintf0 (char * buffer, size_t sizeOfBuffer, const char * format,  ...)
char* strcatAlloc (char ** dest, const char * src)
char* strcpyAlloc (const char * src)
char* strcpyRealloc (char ** dest, const char * src)
char* strFromBlobAlloc (const char * blob, const size_t len)
char* strncat0 (char *const  to, const char *const from, const size_t max)
char* strncpy0 (char *const  to, const char *const from, const size_t maxLen)
int strToInt (int * val, const char *const str)
int strToInt64 (int64_t * val, const char *const str)
int strToLong (long * val, const char *const str)
int strToULong (unsigned long * val, const char *const str)
char* toReadableDump (char * data, size_t len)
Converts the given binary data to a more readable string, the zero bytes are replaced by '*'. 

Parameters:
data The data to convert 
len The length of the binary data 
Returns:
readable is returned, it must be free()'d. If allocation fails NULL is returned 

Definition at line 623 of file helper.c.
Referenced by blobDump(), encodeSocketMessage(), and parseSocketData().void trim (char * s)
strip leading and trailing spaces of the given string 

Definition at line 540 of file helper.c.
Referenced by convertToXmlBlasterException(), parseMsgUnitArr(), and parseSocketData().void trimEnd (char * s)
strip trailing spaces of the given string 

Definition at line 604 of file helper.c.void trimStart (char * s)
strip leading spaces of the given string 

Definition at line 576 of file helper.c.void xb_strerror (char * errnoStr, size_t sizeInBytes, int errnum)
Convert the errnum to a human readable errnoStr. 

Parameters:
errnoStr Out parameter holding the string 
sizeInBytes Size of the buffer 
errnum The error number (errno) 

Definition at line 437 of file helper.c.
References snprintf0(), and strncpy0().
Referenced by initConnection().
Here is the call graph for this function:

IMAGE
void xmlBlasterDefaultLogging (void * logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, const char * location, const char * fmt,  ...)

util/msgUtil.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "helper.h"
#include "msgUtil.h"
#include <netdb.h>
#include <errno.h>

Include dependency graph for msgUtil.c:

IMAGE

Functions
char * getXmlBlasterVersion (void)

Returns:
e.g. 

void xmlBlasterFree (char *p)
Frees the pointer with free(). 

void freeQosArr (QosArr *qosArr)
Frees everything inside QosArr and the struct QosArr itself. 

void freeMsgUnitArr (MsgUnitArr *msgUnitArr)
Frees everything inside MsgUnitArr and the struct MsgUnitArr itself. 

void freeMsgUnitArrInternal (MsgUnitArr *msgUnitArr)
Frees everything inside MsgUnitArr but NOT the struct MsgUnitArr itself. 

void freeMsgUnitData (MsgUnit *msgUnit)
Does not free the msgUnit itself. 

void freeMsgUnit (MsgUnit *msgUnit)
Frees everything. 

char * messageUnitToXmlLimited (MsgUnit *msg, int maxContentDumpLen)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

char * messageUnitToXml (MsgUnit *msg)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

void initializeXmlBlasterException (XmlBlasterException *xmlBlasterException)
Should be called on any xmlBlasterException before using it. 

hostent * gethostbyname_re (char *host, struct hostent *hostbuf, char **tmphstbuf, size_t *hstbuflen, char errP[256])
Thread safe host lookup. 

Function Documentation
void freeMsgUnit (MsgUnit * msgUnit)
Frees everything. 

Definition at line 150 of file msgUtil.c.
References freeMsgUnitData().
Here is the call graph for this function:

IMAGE
void freeMsgUnitArr (MsgUnitArr * msgUnitArr)
Frees everything inside MsgUnitArr and the struct MsgUnitArr itself. 

Parameters:
msgUnitArr The struct to free, passing NULL is OK 

Definition at line 99 of file msgUtil.c.
References freeMsgUnitArrInternal().
Referenced by main(), parseQosArr(), sendResponseOrException(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().
Here is the call graph for this function:

IMAGE
void freeMsgUnitArrInternal (MsgUnitArr * msgUnitArr)
Frees everything inside MsgUnitArr but NOT the struct MsgUnitArr itself. 

Parameters:
msgUnitArr The struct internals to free, passing NULL is OK 

Definition at line 110 of file msgUtil.c.
References freeMsgUnitData(), MsgUnitStructArr::len, and MsgUnitStructArr::msgUnitArr.
Referenced by freeMsgUnitArr(), and main().
Here is the call graph for this function:

IMAGE
void freeMsgUnitData (MsgUnit * msgUnit)
Does not free the msgUnit itself. 

Definition at line 124 of file msgUtil.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnit::key, MsgUnit::qos, and MsgUnit::responseQos.
Referenced by freeMsgUnit(), freeMsgUnitArrInternal(), main(), myUpdate(), xmlBlasterUnmanagedCEPublish(), and xmlBlasterUnmanagedCEPublishOneway().void freeQosArr (QosArr * qosArr)
Frees everything inside QosArr and the struct QosArr itself. 

Parameters:
qosArr The struct to free, passing NULL is OK 

Definition at line 83 of file msgUtil.c.
References QosStructArr::len, and QosStructArr::qosArr.
Referenced by main(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), and xmlBlasterUnmanagedUnSubscribe().struct hostent* gethostbyname_re (char * host, struct hostent * hostbuf, char ** tmphstbuf, size_t * hstbuflen, char errP[256]) [read]
Thread safe host lookup. 

NOTE: If the return is not NULL you need to free(*tmphstbuf) 
Author:
Caolan McNamara (2000) <caolan@skynet.ie> (with some leak fixes by Marcel) 

Definition at line 340 of file msgUtil.c.
Referenced by createCallbackServer(), and initConnection().char* getXmlBlasterVersion (void)

Returns:
e.g. 

"0.848 #1207M" 

Definition at line 47 of file msgUtil.c.
Referenced by main(), and xmlBlasterUnmanagedCEVersion().void initializeXmlBlasterException (XmlBlasterException * xmlBlasterException)
Should be called on any xmlBlasterException before using it. 

Definition at line 207 of file msgUtil.c.
References ExceptionStruct::errorCode, ExceptionStruct::message, and ExceptionStruct::remote.
Referenced by checkArgs(), handleMessage(), sendData(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), and xmlBlasterUnmanagedUnSubscribe().char* messageUnitToXml (MsgUnit * msg)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

Returns:
A ASCII XML formatted message or NULL if out of memory 

Definition at line 199 of file msgUtil.c.
References messageUnitToXmlLimited().
Referenced by myUpdate().
Here is the call graph for this function:

IMAGE
char* messageUnitToXmlLimited (MsgUnit * msg, int maxContentDumpLen)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

Parameters:
msg The message 
maxContentDumpLen for -1 get the complete content, else limit the content to the given number of bytes 
Returns:
A ASCII XML formatted message or NULL if out of memory 

Definition at line 165 of file msgUtil.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnit::key, MsgUnit::qos, SNPRINTF, strcatAlloc(), strcpyAlloc(), strFromBlobAlloc(), and strncpy0().
Referenced by main(), messageUnitToXml(), and myUpdate().
Here is the call graph for this function:

IMAGE
void xmlBlasterFree (char * p)
Frees the pointer with free(). 

Users of this library can use xmlBlasterFree() instead of free(). This can be helpful on Windows and if this client library is a DLL and compiled with /MT but the client code is not (or vice versa). In such a case the executable uses different runtime libraries with different instances of malloc/free.  On UNIX we don't need this function but it doesn't harm either. 

Definition at line 72 of file msgUtil.c.
Referenced by interceptUpdate(), main(), myUpdate(), xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEDisconnect(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEExceptionFree(), xmlBlasterUnmanagedCEFree(), xmlBlasterUnmanagedCEFreePP(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEPing(), xmlBlasterUnmanagedCESubscribe(), and xmlBlasterUnmanagedCEUnSubscribe().

util/msgUtil.h File Reference
#include <util/helper.h>

Include dependency graph for msgUtil.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct MsgUnit
Holds a message All member pointers are allocated with malloc(), you need to free() them Needs to be consistent with MsgUnitUnmanaged declaration in C# (for P/Invoke). 

struct MsgUnitStructArr
Holds an array of Messages. 

struct QosStructArr
Holds an array of QoS XML strings returned by unSubscribe() and erase(). 

struct MsgRequestInfoStruct
Used to transport information back to callback functions. 

Defines
#define MAX_ERRNO_LEN  256
#define XMLBLASTER_MAX_USAGE_LEN  2048
#define MAX_REQUESTID_LEN  256
#define MAX_SECRETSESSIONID_LEN  256
#define MAX_SESSIONID_LEN  256
#define MAX_METHODNAME_LEN  20
#define XMLBLASTER_CONNECT  "connect"
#define XMLBLASTER_DISCONNECT  "disconnect"
#define XMLBLASTER_PING  "ping"
#define XMLBLASTER_UPDATE  "update"
#define XMLBLASTER_UPDATE_ONEWAY  "updateOneway"
#define XMLBLASTER_PUBLISH  "publish"
#define XMLBLASTER_PUBLISH_ONEWAY  "publishOneway"
#define XMLBLASTER_GET  "get"
#define XMLBLASTER_SUBSCRIBE  "subscribe"
#define XMLBLASTER_UNSUBSCRIBE  "unSubscribe"
#define XMLBLASTER_ERASE  "erase"
#define XMLBLASTEREXCEPTION_ERRORCODE_LEN  EXCEPTIONSTRUCT_ERRORCODE_LEN
#define XMLBLASTEREXCEPTION_MESSAGE_LEN  EXCEPTIONSTRUCT_MESSAGE_LEN
Typedefs
typedef BlobHolder XmlBlasterBlob
Holds arbitrary raw data and its length, see helper.h. 

typedef MsgUnitStructArr MsgUnitArr
Holds an array of Messages. 

typedef QosStructArr QosArr
Holds an array of QoS XML strings returned by unSubscribe() and erase(). 

typedef MsgRequestInfoStruct MsgRequestInfo
Used to transport information back to callback functions. 

typedef ExceptionStruct XmlBlasterException
Functions
void initializeXmlBlasterException (XmlBlasterException *xmlBlasterException)
Should be called on any xmlBlasterException before using it. 

const char * getXmlBlasterVersion (void)

Returns:
e.g. 

void xmlBlasterFree (char *p)
Frees the pointer with free(). 

void freeMsgUnitData (MsgUnit *msgUnit)
Does not free the msgUnit itself. 

void freeMsgUnit (MsgUnit *msgUnit)
Frees everything. 

void freeMsgUnitArr (MsgUnitArr *msgUnitArr)
Frees everything inside MsgUnitArr and the struct MsgUnitArr itself. 

void freeMsgUnitArrInternal (MsgUnitArr *msgUnitArr)
Frees everything inside MsgUnitArr but NOT the struct MsgUnitArr itself. 

void freeQosArr (QosArr *qosArr)
Frees everything inside QosArr and the struct QosArr itself. 

char * messageUnitToXml (MsgUnit *msg)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

char * messageUnitToXmlLimited (MsgUnit *msg, int maxContentDumpLen)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

hostent * gethostbyname_re (const char *host, struct hostent *hostbuf, char **tmphstbuf, size_t *hstbuflen, char errP[256])

Define Documentation
#define MAX_ERRNO_LEN  256

Definition at line 18 of file msgUtil.h.
Referenced by createCallbackServer(), and initConnection().#define MAX_METHODNAME_LEN  20

Definition at line 25 of file msgUtil.h.
Referenced by encodeSocketMessage(), handleMessage(), parseSocketData(), and sendData().#define MAX_REQUESTID_LEN  256

Definition at line 20 of file msgUtil.h.
Referenced by handleMessage(), parseSocketData(), and sendData().#define MAX_SECRETSESSIONID_LEN  256

Definition at line 21 of file msgUtil.h.
Referenced by xmlBlasterConnect().#define MAX_SESSIONID_LEN  256

Definition at line 22 of file msgUtil.h.
Referenced by encodeSocketMessage(), and parseSocketData().#define XMLBLASTER_CONNECT  "connect"

Definition at line 26 of file msgUtil.h.
Referenced by sendData(), and xmlBlasterConnect().#define XMLBLASTER_DISCONNECT  "disconnect"

Definition at line 27 of file msgUtil.h.
Referenced by xmlBlasterDisconnect().#define XMLBLASTER_ERASE  "erase"

Definition at line 36 of file msgUtil.h.
Referenced by xmlBlasterErase().#define XMLBLASTER_GET  "get"

Definition at line 33 of file msgUtil.h.
Referenced by xmlBlasterGet().#define XMLBLASTER_MAX_USAGE_LEN  2048

Definition at line 19 of file msgUtil.h.
Referenced by main(), xmlBlasterAccessUnparsedUsage(), xmlBlasterUnmanagedCEUsage(), and xmlBlasterUnmanagedUsage().#define XMLBLASTER_PING  "ping"

Definition at line 28 of file msgUtil.h.
Referenced by xmlBlasterPing().#define XMLBLASTER_PUBLISH  "publish"

Definition at line 31 of file msgUtil.h.
Referenced by xmlBlasterPublish(), and xmlBlasterPublishArr().#define XMLBLASTER_PUBLISH_ONEWAY  "publishOneway"

Definition at line 32 of file msgUtil.h.
Referenced by xbl_isOneway(), and xmlBlasterPublishOneway().#define XMLBLASTER_SUBSCRIBE  "subscribe"

Definition at line 34 of file msgUtil.h.
Referenced by xmlBlasterSubscribe().#define XMLBLASTER_UNSUBSCRIBE  "unSubscribe"

Definition at line 35 of file msgUtil.h.
Referenced by xmlBlasterUnSubscribe().#define XMLBLASTER_UPDATE  "update"

Definition at line 29 of file msgUtil.h.#define XMLBLASTER_UPDATE_ONEWAY  "updateOneway"

Definition at line 30 of file msgUtil.h.
Referenced by sendResponseOrException().#define XMLBLASTEREXCEPTION_ERRORCODE_LEN  EXCEPTIONSTRUCT_ERRORCODE_LEN

Definition at line 96 of file msgUtil.h.
Referenced by checkArgs(), convertToXmlBlasterException(), handleMessage(), initConnection(), initialize(), interceptUpdate(), mutexUnlock(), myUpdate(), parseSocketData(), postSendEvent(), preSendEvent(), sendData(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().#define XMLBLASTEREXCEPTION_MESSAGE_LEN  EXCEPTIONSTRUCT_MESSAGE_LEN

Definition at line 97 of file msgUtil.h.
Referenced by checkArgs(), convertToXmlBlasterException(), createCallbackServer(), handleMessage(), initConnection(), initialize(), interceptUpdate(), mutexUnlock(), myUpdate(), postSendEvent(), preSendEvent(), sendData(), xmlBlasterConnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
Typedef Documentation
typedef struct MsgRequestInfoStruct  MsgRequestInfo
Used to transport information back to callback functions. 

typedef struct MsgUnitStructArr  MsgUnitArr
Holds an array of Messages. 

typedef struct QosStructArr  QosArr
Holds an array of QoS XML strings returned by unSubscribe() and erase(). 

typedef BlobHolder XmlBlasterBlob
Holds arbitrary raw data and its length, see helper.h. 

Definition at line 41 of file msgUtil.h.typedef ExceptionStruct XmlBlasterException

Definition at line 98 of file msgUtil.h.
Function Documentation
void freeMsgUnit (MsgUnit * msgUnit)
Frees everything. 

Definition at line 150 of file msgUtil.c.
References freeMsgUnitData().
Here is the call graph for this function:

IMAGE
void freeMsgUnitArr (MsgUnitArr * msgUnitArr)
Frees everything inside MsgUnitArr and the struct MsgUnitArr itself. 

Parameters:
msgUnitArr The struct to free, passing NULL is OK 

Definition at line 99 of file msgUtil.c.
References freeMsgUnitArrInternal().
Referenced by main(), parseQosArr(), sendResponseOrException(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().
Here is the call graph for this function:

IMAGE
void freeMsgUnitArrInternal (MsgUnitArr * msgUnitArr)
Frees everything inside MsgUnitArr but NOT the struct MsgUnitArr itself. 

Parameters:
msgUnitArr The struct internals to free, passing NULL is OK 

Definition at line 110 of file msgUtil.c.
References freeMsgUnitData(), MsgUnitStructArr::len, and MsgUnitStructArr::msgUnitArr.
Referenced by freeMsgUnitArr(), and main().
Here is the call graph for this function:

IMAGE
void freeMsgUnitData (MsgUnit * msgUnit)
Does not free the msgUnit itself. 

Definition at line 124 of file msgUtil.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnit::key, MsgUnit::qos, and MsgUnit::responseQos.
Referenced by freeMsgUnit(), freeMsgUnitArrInternal(), main(), myUpdate(), xmlBlasterUnmanagedCEPublish(), and xmlBlasterUnmanagedCEPublishOneway().void freeQosArr (QosArr * qosArr)
Frees everything inside QosArr and the struct QosArr itself. 

Parameters:
qosArr The struct to free, passing NULL is OK 

Definition at line 83 of file msgUtil.c.
References QosStructArr::len, and QosStructArr::qosArr.
Referenced by main(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), and xmlBlasterUnmanagedUnSubscribe().struct hostent* gethostbyname_re (const char * host, struct hostent * hostbuf, char ** tmphstbuf, size_t * hstbuflen, char errP[256]) [read]
const char* getXmlBlasterVersion (void)

Returns:
e.g. 

"0.848 #1207M" 

Definition at line 47 of file msgUtil.c.
Referenced by main(), and xmlBlasterUnmanagedCEVersion().void initializeXmlBlasterException (XmlBlasterException * xmlBlasterException)
Should be called on any xmlBlasterException before using it. 

Definition at line 207 of file msgUtil.c.
References ExceptionStruct::errorCode, ExceptionStruct::message, and ExceptionStruct::remote.
Referenced by checkArgs(), handleMessage(), sendData(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEUnSubscribe(), xmlBlasterUnmanagedErase(), and xmlBlasterUnmanagedUnSubscribe().char* messageUnitToXml (MsgUnit * msg)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

Returns:
A ASCII XML formatted message or NULL if out of memory 

Definition at line 199 of file msgUtil.c.
References messageUnitToXmlLimited().
Referenced by myUpdate().
Here is the call graph for this function:

IMAGE
char* messageUnitToXmlLimited (MsgUnit * msg, int maxContentDumpLen)
NOTE: You need to free the returned pointer with xmlBlasterFree() or directly with free()! 

Parameters:
msg The message 
maxContentDumpLen for -1 get the complete content, else limit the content to the given number of bytes 
Returns:
A ASCII XML formatted message or NULL if out of memory 

Definition at line 165 of file msgUtil.c.
References MsgUnit::content, MsgUnit::contentLen, MsgUnit::key, MsgUnit::qos, SNPRINTF, strcatAlloc(), strcpyAlloc(), strFromBlobAlloc(), and strncpy0().
Referenced by main(), messageUnitToXml(), and myUpdate().
Here is the call graph for this function:

IMAGE
void xmlBlasterFree (char * p)
Frees the pointer with free(). 

Users of this library can use xmlBlasterFree() instead of free(). This can be helpful on Windows and if this client library is a DLL and compiled with /MT but the client code is not (or vice versa). In such a case the executable uses different runtime libraries with different instances of malloc/free.  On UNIX we don't need this function but it doesn't harm either. 

Definition at line 72 of file msgUtil.c.
Referenced by interceptUpdate(), main(), myUpdate(), xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEDisconnect(), xmlBlasterUnmanagedCEErase(), xmlBlasterUnmanagedCEExceptionFree(), xmlBlasterUnmanagedCEFree(), xmlBlasterUnmanagedCEFreePP(), xmlBlasterUnmanagedCEGet(), xmlBlasterUnmanagedCEPing(), xmlBlasterUnmanagedCESubscribe(), and xmlBlasterUnmanagedCEUnSubscribe().

util/Properties.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "helper.h"
#include "Properties.h"

Include dependency graph for Properties.c:

IMAGE

Functions
static char * getString (Properties *props, char *key, char *defaultValue)
See header Properties.h for documentation. 

static int getBool (Properties *props, char *key, int defaultValue)
static int getInt (Properties *props, char *key, int defaultValue)
static long getLong (Properties *props, char *key, long defaultValue)
static int64_t getInt64 (Properties *props, char *key, int64_t defaultValue)
Properties * createProperties (int argc, char **argv)
Create an instance of a property struct. 

void freeProperties (Properties *props)
Free your instance after accessing xmlBlaster. 

void dumpProperties (Properties *props)
Dump properties to console, for debugging only. 

Function Documentation
Properties* createProperties (int argc, char ** argv)
Create an instance of a property struct. 

NOTE: Our properties point on the passed argv memory, so you should not free the original argv memory. 
Parameters:
argc The number of command line args 
argv The command line arguments, argv[0] is expected to be the name of the process, argv[1] should start with '-' and argv[2] is the value of the argv[1] key ... argv can be NULL if argc == 0 

Definition at line 35 of file Properties.c.
References PropertiesStruct::argc, PropertiesStruct::argv, PropertiesStruct::execName, getBool(), PropertiesStruct::getBool, getInt(), PropertiesStruct::getInt, getInt64(), PropertiesStruct::getInt64, getLong(), PropertiesStruct::getLong, getString(), and PropertiesStruct::getString.
Referenced by getCallbackServerUnparsed(), getXmlBlasterAccessUnparsed(), and getXmlBlasterConnectionUnparsed().
Here is the call graph for this function:

IMAGE
void dumpProperties (Properties * props)
Dump properties to console, for debugging only. 

Definition at line 78 of file Properties.c.
References PropertiesStruct::argc, and PropertiesStruct::argv.void freeProperties (Properties * props)
Free your instance after accessing xmlBlaster. 

Definition at line 63 of file Properties.c.
References PropertiesStruct::argc, and PropertiesStruct::argv.
Referenced by freeCallbackServerUnparsed(), freeXmlBlasterAccessUnparsed(), and freeXmlBlasterConnectionUnparsed().static int getBool (Properties * props, char * key, int defaultValue) [static]

Definition at line 134 of file Properties.c.
References getString().
Referenced by createProperties().
Here is the call graph for this function:

IMAGE
static int getInt (Properties * props, char * key, int defaultValue) [static]

Definition at line 146 of file Properties.c.
References getLong().
Referenced by createProperties().
Here is the call graph for this function:

IMAGE
static int64_t getInt64 (Properties * props, char * key, int64_t defaultValue) [static]

Definition at line 162 of file Properties.c.
References getString(), and strToInt64().
Referenced by createProperties().
Here is the call graph for this function:

IMAGE
static long getLong (Properties * props, char * key, long defaultValue) [static]

Definition at line 151 of file Properties.c.
References getString(), and strToLong().
Referenced by createProperties(), and getInt().
Here is the call graph for this function:

IMAGE
static char * getString (Properties * props, char * key, char * defaultValue) [static]
See header Properties.h for documentation. 

Definition at line 92 of file Properties.c.
References PropertiesStruct::argc, and PropertiesStruct::argv.
Referenced by createProperties(), getBool(), getInt64(), and getLong().

util/Properties.h File Reference
#include <util/basicDefs.h>

Include dependency graph for Properties.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct PropertiesStruct
All client access to Properties goes over this struct and its function pointers. 

Typedefs
typedef PropertiesStruct Properties
typedef const char *(*) XmlBlasterPropertiesGetString (Properties *xb, const char *key, const char *defaultValue)
typedef int(*) XmlBlasterPropertiesGetBool (Properties *xb, const char *key, int defaultValue)
typedef int(*) XmlBlasterPropertiesGetInt (Properties *xb, const char *key, int defaultValue)
typedef long(*) XmlBlasterPropertiesGetLong (Properties *xb, const char *key, long defaultValue)
typedef int64_t(*) XmlBlasterPropertiesGetInt64 (Properties *xb, const char *key, int64_t defaultValue)
Functions
Properties * createProperties (int argc, const char *const *argv)
Get an instance of this Properties struct. 

void freeProperties (Properties *props)
Free your instance after accessing xmlBlaster. 

void dumpProperties (Properties *props)
Dump properties to console, for debugging only. 

Typedef Documentation
typedef struct PropertiesStruct Properties

Definition at line 22 of file Properties.h.typedef int( * ) XmlBlasterPropertiesGetBool(Properties *xb, const char *key, int defaultValue)

Definition at line 26 of file Properties.h.typedef int( * ) XmlBlasterPropertiesGetInt(Properties *xb, const char *key, int defaultValue)

Definition at line 27 of file Properties.h.typedef int64_t( * ) XmlBlasterPropertiesGetInt64(Properties *xb, const char *key, int64_t defaultValue)

Definition at line 29 of file Properties.h.typedef long( * ) XmlBlasterPropertiesGetLong(Properties *xb, const char *key, long defaultValue)

Definition at line 28 of file Properties.h.typedef const char*( * ) XmlBlasterPropertiesGetString(Properties *xb, const char *key, const char *defaultValue)

Definition at line 25 of file Properties.h.
Function Documentation
Properties* createProperties (int argc, const char *const * argv)
Get an instance of this Properties struct. 

NOTE: Every call creates a new and independent instance 
Parameters:
argc Number of argv entries 
argv The first entry is expected to be the executable name, the others are tuples of form "-logLevel" "TRACE" 
Returns:
NULL if bootstrapping failed. If not NULL you need to free() it when you are done usually by calling freeProperties(). 
void dumpProperties (Properties * props)
Dump properties to console, for debugging only. 

Definition at line 78 of file Properties.c.
References PropertiesStruct::argc, and PropertiesStruct::argv.void freeProperties (Properties * props)
Free your instance after accessing xmlBlaster. 

Definition at line 63 of file Properties.c.
References PropertiesStruct::argc, and PropertiesStruct::argv.
Referenced by freeCallbackServerUnparsed(), freeXmlBlasterAccessUnparsed(), and freeXmlBlasterConnectionUnparsed().

util/queue/QueueInterface.h File Reference
#include "util/helper.h"

Include dependency graph for QueueInterface.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct QueueProperties
The QueueProperty struct holds all configuration parameters of the queue to create. 

struct QueueEntry
A struct holding the necessary queue entry informations used by I_Queue. 

struct QueueEntryStructArr
Holds an array of Messages. 

struct I_QueueStruct
Interface for a queue implementation. 

Defines
#define QUEUE_ENTRY_EMBEDDEDTYPE_LEN  28
#define QUEUE_PREFIX_MAX  20
#define QUEUE_DBNAME_MAX  256
#define QUEUE_ID_MAX  256
Typedefs
typedef QueueEntryStructArr QueueEntryArr
Holds an array of Messages. 

typedef I_QueueStruct I_Queue
typedef int(*) I_QueueInitialize (I_Queue *queueP, const QueueProperties *queueProperties, ExceptionStruct *exception)
Declare function pointers to use in struct to simulate object oriented access. 

typedef void(*) I_QueueShutdown (I_Queue **queuePP, ExceptionStruct *exception)
typedef int(*) I_QueueDestroy (I_Queue **queuePP, ExceptionStruct *exception)
typedef const QueueProperties *(*) I_QueueGetProperties (I_Queue *queueP)
typedef void(*) I_QueuePut (I_Queue *queueP, const QueueEntry *queueEntry, ExceptionStruct *exception)
typedef QueueEntryArr *(*) I_QueuePeekWithSamePriority (I_Queue *queueP, int32_t maxNumOfEntries, int64_t maxNumOfBytes, ExceptionStruct *exception)
typedef int32_t(*) I_QueueRandomRemove (I_Queue *queueP, const QueueEntryArr *queueEntryArr, ExceptionStruct *exception)
typedef int(*) I_QueueClear (I_Queue *queueP, ExceptionStruct *exception)
typedef int(*) I_QueueEmpty (I_Queue *queueP)
typedef int32_t(*) I_QueueNumOfEntries (I_Queue *queueP)
typedef int32_t(*) I_QueueMaxNumOfEntries (I_Queue *queueP)
typedef int64_t(*) I_QueueNumOfBytes (I_Queue *queueP)
typedef int64_t(*) I_QueueMaxNumOfBytes (I_Queue *queueP)
Functions
I_Queue * createQueue (const QueueProperties *queueProperties, ExceptionStruct *exception)
Get an instance of a persistent queue and initialize it. 

void freeQueueEntryArr (QueueEntryArr *queueEntryArr)
Frees everything inside QueueEntryArr and the struct QueueEntryArr itself. 

void freeQueueEntryArrInternal (QueueEntryArr *queueEntryArr)
Frees everything inside QueueEntryArr but NOT the struct QueueEntryArr itself. 

void freeQueueEntry (QueueEntry *queueEntry)
Frees the internal blob and the queueEntry itself. 

char * queueEntryToXml (QueueEntry *queueEntry, int maxContentDumpLen)
NOTE: You need to free the returned pointer with freeEntryDump() (which calls free())! 

void freeEntryDump (char *queueDump)
Free the memory allocated by queueEntryToXml(). 

Define Documentation
#define QUEUE_DBNAME_MAX  256

Definition at line 27 of file QueueInterface.h.
Referenced by destroy(), persistentQueueInitialize(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().#define QUEUE_ENTRY_EMBEDDEDTYPE_LEN  28

Definition at line 24 of file QueueInterface.h.
Referenced by parseQueueEntryArr(), persistentQueuePut(), queueEntryToXml(), test_overflow(), and test_queue().#define QUEUE_ID_MAX  256

Definition at line 28 of file QueueInterface.h.
Referenced by destroy(), persistentQueueInitialize(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().#define QUEUE_PREFIX_MAX  20

Definition at line 26 of file QueueInterface.h.
Referenced by destroy(), persistentQueueInitialize(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().
Typedef Documentation
typedef struct I_QueueStruct I_Queue

Definition at line 65 of file QueueInterface.h.typedef int( * ) I_QueueClear(I_Queue *queueP, ExceptionStruct *exception)

Definition at line 75 of file QueueInterface.h.typedef int( * ) I_QueueDestroy(I_Queue **queuePP, ExceptionStruct *exception)

Definition at line 70 of file QueueInterface.h.typedef int( * ) I_QueueEmpty(I_Queue *queueP)

Definition at line 76 of file QueueInterface.h.typedef const QueueProperties*( * ) I_QueueGetProperties(I_Queue *queueP)

Definition at line 71 of file QueueInterface.h.typedef int( * ) I_QueueInitialize(I_Queue *queueP, const QueueProperties *queueProperties, ExceptionStruct *exception)
Declare function pointers to use in struct to simulate object oriented access. 

Definition at line 68 of file QueueInterface.h.typedef int64_t( * ) I_QueueMaxNumOfBytes(I_Queue *queueP)

Definition at line 80 of file QueueInterface.h.typedef int32_t( * ) I_QueueMaxNumOfEntries(I_Queue *queueP)

Definition at line 78 of file QueueInterface.h.typedef int64_t( * ) I_QueueNumOfBytes(I_Queue *queueP)

Definition at line 79 of file QueueInterface.h.typedef int32_t( * ) I_QueueNumOfEntries(I_Queue *queueP)

Definition at line 77 of file QueueInterface.h.typedef QueueEntryArr*( * ) I_QueuePeekWithSamePriority(I_Queue *queueP, int32_t maxNumOfEntries, int64_t maxNumOfBytes, ExceptionStruct *exception)

Definition at line 73 of file QueueInterface.h.typedef void( * ) I_QueuePut(I_Queue *queueP, const QueueEntry *queueEntry, ExceptionStruct *exception)

Definition at line 72 of file QueueInterface.h.typedef int32_t( * ) I_QueueRandomRemove(I_Queue *queueP, const QueueEntryArr *queueEntryArr, ExceptionStruct *exception)

Definition at line 74 of file QueueInterface.h.typedef void( * ) I_QueueShutdown(I_Queue **queuePP, ExceptionStruct *exception)

Definition at line 69 of file QueueInterface.h.typedef struct QueueEntryStructArr  QueueEntryArr
Holds an array of Messages. 

Function Documentation
I_Queue* createQueue (const QueueProperties * queueProperties, ExceptionStruct * exception)
Get an instance of a persistent queue and initialize it. 

Every call creates a new and independent instance which shall be destroyed by a call to freeQueue() when you are done
Parameters:
queueProperties Configuration properties of the queue, always do a first memset(&queueProperties, 0, sizeof(QueueProperties));  to initialize new, future members.
 
        dbName The database name, for SQLite it is the file name on HD, "xmlBlasterClient.db"        queueName The name of the queue, "connection_clientJoe"        maxNumOfEntries The max. accepted entries, 10000000l        maxNumOfBytes The max. accepted bytes, 1000000000ll        logFp Your logging implementation or NULL if no logging callbacks are desired        logLevel Set to LOG_TRACE to receive any logging        userObject A pointer of your choice, is passed back when calling logFp in queueP->userObject 
 
exception 
Returns:
queueP The 'this' pointer 

Referenced by destroy(), test_illegal(), test_overflow(), test_queue(), and xmlBlasterInitQueue().void freeEntryDump (char * queueDump)
Free the memory allocated by queueEntryToXml(). 

Parameters:
queueDump NULL is OK 

Definition at line 1224 of file SQLiteQueue.c.
Referenced by test_queue().void freeQueueEntry (QueueEntry * queueEntry)
Frees the internal blob and the queueEntry itself. 

Parameters:
queueEntry Its memory is freed, it is not usable anymore after this call 

Definition at line 1179 of file SQLiteQueue.c.
References freeQueueEntryData().
Here is the call graph for this function:

IMAGE
void freeQueueEntryArr (QueueEntryArr * queueEntryArr)
Frees everything inside QueueEntryArr and the struct QueueEntryArr itself. 

Parameters:
queueEntryArr The struct to free, passing NULL is OK 

Definition at line 1140 of file SQLiteQueue.c.
References freeQueueEntryArrInternal().
Referenced by test_illegal(), and test_queue().
Here is the call graph for this function:

IMAGE
void freeQueueEntryArrInternal (QueueEntryArr * queueEntryArr)
Frees everything inside QueueEntryArr but NOT the struct QueueEntryArr itself. 

Parameters:
queueEntryArr The struct internals to free, passing NULL is OK 

Definition at line 1151 of file SQLiteQueue.c.
References freeQueueEntryData(), QueueEntryStructArr::len, and QueueEntryStructArr::queueEntryArr.
Referenced by freeQueueEntryArr().
Here is the call graph for this function:

IMAGE
char* queueEntryToXml (QueueEntry * queueEntry, int maxContentDumpLen)
NOTE: You need to free the returned pointer with freeEntryDump() (which calls free())! 

Parameters:
queueEntry The data to put to the queue 
maxContentDumpLen for -1 get the complete content, else limit the content to the given number of bytes 
Returns:
A ASCII XML formatted entry or NULL if out of memory 

Definition at line 1194 of file SQLiteQueue.c.
References BlobHolder::data, BlobHolder::dataLen, QueueEntry::embeddedBlob, QueueEntry::embeddedType, int64Str, int64ToStr(), QueueEntry::isPersistent, QueueEntry::priority, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, SNPRINTF, strFromBlobAlloc(), and QueueEntry::uniqueId.
Referenced by test_queue().
Here is the call graph for this function:

IMAGE

util/queue/SQLiteQueue.c File Reference
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#include <errno.h>
#include "util/queue/QueueInterface.h"
#include "sqlite.h"

Include dependency graph for SQLiteQueue.c:

IMAGE

Data Structures
struct DbInfoStruct
Holds Prepared statements for better performance. 

struct TmpHelper
Used temporary for peekWithSamePriority(). 

Defines
#define LOG  if (queueP && queueP->log) queueP->log(queueP, queueP->logLevel, XMLBLASTER_LOG_TRACE,
#define LEN512  512
#define LEN256  256
#define DBNAME_MAX  128
#define ID_MAX  256
Typedefs
typedef int(*) ParseDataFp (I_Queue *queueP, size_t currIndex, void *userP, char **pazValue, char **pazColName, ExceptionStruct *exception)
Called for each SQL result row and does the specific result parsing depending on the query. 

typedef DbInfoStruct DbInfo
Holds Prepared statements for better performance. 

Enumerations
enum { XB_ENTRIES_DATA_ID =  0, XB_ENTRIES_QUEUE_NAME, XB_ENTRIES_PRIO, XB_ENTRIES_TYPE_NAME, XB_ENTRIES_PERSISTENT, XB_ENTRIES_SIZE_IN_BYTES, XB_ENTRIES_BLOB }
Column index into XB_ENTRIES table. 

Functions
static int persistentQueueInitialize (I_Queue *queueP, QueueProperties *queueProperties, ExceptionStruct *exception)
Called internally by createQueue(). 

static QueueProperties * getProperties (I_Queue *queueP)
Access the queue configuration. 

static void persistentQueuePut (I_Queue *queueP, QueueEntry *queueEntry, ExceptionStruct *exception)

Parameters:
queueP The queue instance 

static QueueEntryArr * persistentQueuePeekWithSamePriority (I_Queue *queueP, int32_t maxNumOfEntries, int64_t maxNumOfBytes, ExceptionStruct *exception)
Access queue entries without removing them. 

static int32_t persistentQueueRandomRemove (I_Queue *queueP, QueueEntryArr *queueEntryArr, ExceptionStruct *exception)
Removes the given entries from persistence. 

static int persistentQueueClear (I_Queue *queueP, ExceptionStruct *exception)
Destroy all entries in queue. 

static int32_t getNumOfEntries (I_Queue *queueP)
static int32_t getMaxNumOfEntries (I_Queue *queueP)
static int64_t getNumOfBytes (I_Queue *queueP)
static int64_t getMaxNumOfBytes (I_Queue *queueP)
static int persistentQueueEmpty (I_Queue *queueP)
static void persistentQueueShutdown (I_Queue **queuePP, ExceptionStruct *exception)
Shutdown without destroying any entry. 

static int persistentQueueDestroy (I_Queue **queuePP, ExceptionStruct *exception)
Destroy all entries in queue and releases all resources in memory and on HD. 

static int checkArgs (I_Queue *queueP, char *methodName, int checkIsConnected, ExceptionStruct *exception)
Checks the given arguments to be valid. 

static int createTables (I_Queue *queueP, ExceptionStruct *exception)
Create the necessary DB table if not already existing. 

static int execSilent (I_Queue *queueP, char *queryString, char *comment, ExceptionStruct *exception)
Invoke SQL query. 

static int compilePreparedQuery (I_Queue *queueP, char *methodName, sqlite_vm **ppVm, char *queryString, ExceptionStruct *exception)
Compile a prepared query. 

static int fillCache (I_Queue *queueP, ExceptionStruct *exception)
Reload cached information from database. 

static void shutdownInternal (I_Queue **queuePP, ExceptionStruct *exception)
Shutdown used internally without calling freeQueue(). 

static void freeQueueEntryData (QueueEntry *queueEntry)
Does not free the queueEntry itself. 

static int32_t getResultRows (I_Queue *queueP, char *methodName, sqlite_vm *pVm, ParseDataFp parseDataFp, void *userP, int finalize, ExceptionStruct *exception)
Execute the query and get the query result. 

I_Queue * createQueue (QueueProperties *queueProperties, ExceptionStruct *exception)
Create a new persistent queue instance. 

static DbInfo * getDbInfo (I_Queue *queueP)
Access the DB handle, queueP pointer is not checked. 

static void freeQueue (I_Queue **queuePP)
static int parseQueueEntryArr (I_Queue *queueP, size_t currIndex, void *userP, char **pazValue, char **pazColName, ExceptionStruct *exception)
For each SQL result row parse it into a QueueEntry. 

static int parseCacheInfo (I_Queue *queueP, size_t currIndex, void *userP, char **pazValue, char **pazColName, ExceptionStruct *exception)
Parse response of "SELECT count(dataId), sum(byteSize) FROM %.20sENTRIES where queueName='%s'",. 

void freeQueueEntryArr (QueueEntryArr *queueEntryArr)
Frees everything inside QueueEntryArr and the struct QueueEntryArr itself. 

void freeQueueEntryArrInternal (QueueEntryArr *queueEntryArr)
Frees everything inside QueueEntryArr but NOT the struct QueueEntryArr itself. 

void freeQueueEntry (QueueEntry *queueEntry)
Frees the internal blob and the queueEntry itself. 

char * queueEntryToXml (QueueEntry *queueEntry, int maxContentDumpLen)
NOTE: You need to free the returned pointer with freeEntryDump() (which calls free())! 

void freeEntryDump (char *entryDump)
Free the memory allocated by queueEntryToXml(). 

Variables
static char int64Str_ [22]
static char * int64Str = int64Str_

Define Documentation
#define DBNAME_MAX  128

Definition at line 102 of file SQLiteQueue.c.#define ID_MAX  256

Definition at line 103 of file SQLiteQueue.c.
Referenced by persistentQueueRandomRemove().#define LEN256  256

Definition at line 100 of file SQLiteQueue.c.
Referenced by persistentQueueClear(), and persistentQueuePut().#define LEN512  512

Definition at line 99 of file SQLiteQueue.c.
Referenced by createTables(), fillCache(), and persistentQueuePeekWithSamePriority().#define LOG  if (queueP && queueP->log) queueP->log(queueP, queueP->logLevel, XMLBLASTER_LOG_TRACE,

Definition at line 97 of file SQLiteQueue.c.
Referenced by checkArgs(), compilePreparedQuery(), createQueue(), execSilent(), fillCache(), freeQueue(), getResultRows(), parseQueueEntryArr(), persistentQueueClear(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), and shutdownInternal().
Typedef Documentation
typedef struct DbInfoStruct  DbInfo
Holds Prepared statements for better performance. 

See also:
http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html 
typedef int( * ) ParseDataFp(I_Queue *queueP, size_t currIndex, void *userP, char **pazValue, char **pazColName, ExceptionStruct *exception)
Called for each SQL result row and does the specific result parsing depending on the query. 

Parameters:
userP Pointer on a data struct which contains the parsed data 
Returns:
true->to continue, false->to break execution or on error exception->errorCode is not null 

Definition at line 85 of file SQLiteQueue.c.
Enumeration Type Documentation
anonymous enum
Column index into XB_ENTRIES table. 

Enumerator: 
XB_ENTRIES_DATA_ID  
XB_ENTRIES_QUEUE_NAME  
XB_ENTRIES_PRIO  
XB_ENTRIES_TYPE_NAME  
XB_ENTRIES_PERSISTENT  
XB_ENTRIES_SIZE_IN_BYTES  
XB_ENTRIES_BLOB  

Definition at line 133 of file SQLiteQueue.c.
Function Documentation
static int checkArgs (I_Queue * queueP, char * methodName, int checkIsConnected, ExceptionStruct * exception) [static]
Checks the given arguments to be valid. 

Parameters:
queueP The queue instance 
methodName For logging 
checkIsConnected If true does check the connection state as well 
exception Transporting errors 
Returns:
false if the parameters are not usable, in this case 'exception' is filled with detail informations 

Definition at line 1238 of file SQLiteQueue.c.
References ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, initializeExceptionStruct(), I_QueueStruct::isInitialized, LOG, ExceptionStruct::message, I_QueueStruct::privateObject, SNPRINTF, and strncpy0().
Referenced by fillCache(), getMaxNumOfBytes(), getMaxNumOfEntries(), getNumOfBytes(), getNumOfEntries(), getProperties(), initialize(), persistentQueueClear(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), persistentQueueShutdown(), shutdownInternal(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterInitQueue(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().
Here is the call graph for this function:

IMAGE
static int compilePreparedQuery (I_Queue * queueP, char * methodName, sqlite_vm ** ppVm, char * queryString, ExceptionStruct * exception) [static]
Compile a prepared query. 

No parameters are checked, they must be valid 
Parameters:
queueP The queue instance to use 
methodName A nice string for logging 
ppVm The virtual machine will be initialized if still 0 
queryString 
exception The exception is set to *exception->errorCode==0 on success, else to != 0 
Returns:
false on error and exception->errorCode is not null 

Definition at line 539 of file SQLiteQueue.c.
References DbInfoStruct::db, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getDbInfo(), LOG, ExceptionStruct::message, sleepMillis(), SNPRINTF, and strncpy0().
Referenced by fillCache(), persistentQueueClear(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), and persistentQueueRandomRemove().
Here is the call graph for this function:

IMAGE
I_Queue* createQueue (QueueProperties * queueProperties, ExceptionStruct * exception)
Create a new persistent queue instance. 

 
Returns:
NULL if bootstrapping failed. If not NULL you need to free() it when you are done usually by calling shutdown(). 
Exceptions:
exception 

Definition at line 151 of file SQLiteQueue.c.
References I_QueueStruct::clear, I_QueueStruct::destroy, embedException(), I_QueueStruct::empty, ExceptionStruct::errorCode, getMaxNumOfBytes(), I_QueueStruct::getMaxNumOfBytes, getMaxNumOfEntries(), I_QueueStruct::getMaxNumOfEntries, getNumOfBytes(), I_QueueStruct::getNumOfBytes, getNumOfEntries(), I_QueueStruct::getNumOfEntries, getProperties(), I_QueueStruct::getProperties, I_QueueStruct::initialize, I_QueueStruct::isInitialized, LOG, ExceptionStruct::message, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, I_QueueStruct::peekWithSamePriority, persistentQueueClear(), persistentQueueDestroy(), persistentQueueEmpty(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), persistentQueueShutdown(), I_QueueStruct::privateObject, I_QueueStruct::put, I_QueueStruct::randomRemove, and I_QueueStruct::shutdown.
Here is the call graph for this function:

IMAGE
static int createTables (I_Queue * queueP, ExceptionStruct * exception) [static]
Create the necessary DB table if not already existing. 

Parameters:
queueP 
exception Can contain error information (out parameter) 
Returns:
true on success 

Definition at line 338 of file SQLiteQueue.c.
References execSilent(), LEN512, I_QueueStruct::privateObject, and SNPRINTF.
Referenced by persistentQueueInitialize().
Here is the call graph for this function:

IMAGE
static int execSilent (I_Queue * queueP, char * queryString, char * comment, ExceptionStruct * exception) [static]
Invoke SQL query. 

Parameters:
queueP Is not checked, must not be 0 
queryString The SQL to execute 
comment For logging or exception text 
exception Can contain error information (out parameter) 
Returns:
true on success 

Definition at line 362 of file SQLiteQueue.c.
References DbInfoStruct::db, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getDbInfo(), LOG, ExceptionStruct::message, SNPRINTF, and strncpy0().
Referenced by createTables().
Here is the call graph for this function:

IMAGE
static int fillCache (I_Queue * queueP, ExceptionStruct * exception) [static]
Reload cached information from database. 

Parameters:
queueP The this pointer 
exception Returns error 
Returns:
false on error 

Definition at line 1010 of file SQLiteQueue.c.
References checkArgs(), compilePreparedQuery(), getDbInfo(), getResultRows(), int64Str, int64ToStr(), LEN512, LOG, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, parseCacheInfo(), DbInfoStruct::prop, DbInfoStruct::pVm_fillCache, QueueProperties::queueName, SNPRINTF, and QueueProperties::tablePrefix.
Referenced by getNumOfBytes(), getNumOfEntries(), persistentQueueInitialize(), and persistentQueueRandomRemove().
Here is the call graph for this function:

IMAGE
void freeEntryDump (char * queueDump)
Free the memory allocated by queueEntryToXml(). 

Parameters:
queueDump NULL is OK 

Definition at line 1224 of file SQLiteQueue.c.
Referenced by test_queue().static void freeQueue (I_Queue ** queuePP) [static]

Definition at line 210 of file SQLiteQueue.c.
References LOG, and I_QueueStruct::privateObject.
Referenced by persistentQueueDestroy(), and persistentQueueShutdown().void freeQueueEntry (QueueEntry * queueEntry)
Frees the internal blob and the queueEntry itself. 

Parameters:
queueEntry Its memory is freed, it is not usable anymore after this call 

Definition at line 1179 of file SQLiteQueue.c.
References freeQueueEntryData().
Here is the call graph for this function:

IMAGE
void freeQueueEntryArr (QueueEntryArr * queueEntryArr)
Frees everything inside QueueEntryArr and the struct QueueEntryArr itself. 

Parameters:
queueEntryArr The struct to free, passing NULL is OK 

Definition at line 1140 of file SQLiteQueue.c.
References freeQueueEntryArrInternal().
Referenced by test_illegal(), and test_queue().
Here is the call graph for this function:

IMAGE
void freeQueueEntryArrInternal (QueueEntryArr * queueEntryArr)
Frees everything inside QueueEntryArr but NOT the struct QueueEntryArr itself. 

Parameters:
queueEntryArr The struct internals to free, passing NULL is OK 

Definition at line 1151 of file SQLiteQueue.c.
References freeQueueEntryData(), QueueEntryStructArr::len, and QueueEntryStructArr::queueEntryArr.
Referenced by freeQueueEntryArr().
Here is the call graph for this function:

IMAGE
static void freeQueueEntryData (QueueEntry * queueEntry) [static]
Does not free the queueEntry itself. 

Definition at line 1165 of file SQLiteQueue.c.
References BlobHolder::data, BlobHolder::dataLen, and QueueEntry::embeddedBlob.
Referenced by freeQueueEntry(), and freeQueueEntryArrInternal().static DbInfo* getDbInfo (I_Queue * queueP) [static]
Access the DB handle, queueP pointer is not checked. 

Definition at line 192 of file SQLiteQueue.c.
References I_QueueStruct::privateObject.
Referenced by compilePreparedQuery(), execSilent(), fillCache(), getMaxNumOfBytes(), getMaxNumOfEntries(), getNumOfBytes(), getNumOfEntries(), getProperties(), parseCacheInfo(), persistentQueueClear(), persistentQueueDestroy(), persistentQueueInitialize(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), and shutdownInternal().static int64_t getMaxNumOfBytes (I_Queue * queueP) [static]

Definition at line 1077 of file SQLiteQueue.c.
References checkArgs(), getDbInfo(), QueueProperties::maxNumOfBytes, and DbInfoStruct::prop.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int32_t getMaxNumOfEntries (I_Queue * queueP) [static]

Definition at line 1055 of file SQLiteQueue.c.
References checkArgs(), getDbInfo(), QueueProperties::maxNumOfEntries, and DbInfoStruct::prop.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int64_t getNumOfBytes (I_Queue * queueP) [static]

Definition at line 1064 of file SQLiteQueue.c.
References checkArgs(), fillCache(), getDbInfo(), and DbInfoStruct::numOfBytes.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int32_t getNumOfEntries (I_Queue * queueP) [static]

Definition at line 1042 of file SQLiteQueue.c.
References checkArgs(), fillCache(), getDbInfo(), and DbInfoStruct::numOfEntries.
Referenced by createQueue(), and persistentQueueEmpty().
Here is the call graph for this function:

IMAGE
static QueueProperties * getProperties (I_Queue * queueP) [static]
Access the queue configuration. 

Parameters:
queueP The this pointer 
Returns:
Read only access, 0 on error 

Definition at line 201 of file SQLiteQueue.c.
References checkArgs(), getDbInfo(), and DbInfoStruct::prop.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int32_t getResultRows (I_Queue * queueP, char * methodName, sqlite_vm * pVm, ParseDataFp parseDataFp, void * userP, int finalize, ExceptionStruct * exception) [static]
Execute the query and get the query result. 

No parameters are checked, they must be valid 
Parameters:
queueP The this pointer 
methodName The method called 
pVm sqlite virtual machine 
parseDataFp The function which is called for each SQL result row or 0 if no function shall be called 
userP The pointer which is passed to parseDataFp 
finalize true to call sqlite_finalize which deletes the virtual machine, false to call sqlite_reset to reuse the prepared query 
exception The exception is set to *exception->errorCode==0 on success, else to != 0 
Returns:
< 0 on error and exception->errorCode is not null otherwise the number of successfully parsed rows is returned 
Todo:
For INSERT and DELETE return the number of touched entries !!! 

Definition at line 699 of file SQLiteQueue.c.
References ExceptionStruct::errorCode, LOG, and sleepMillis().
Referenced by fillCache(), persistentQueueClear(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), and persistentQueueRandomRemove().
Here is the call graph for this function:

IMAGE
static int parseCacheInfo (I_Queue * queueP, size_t currIndex, void * userP, char ** pazValue, char ** pazColName, ExceptionStruct * exception) [static]
Parse response of "SELECT count(dataId), sum(byteSize) FROM %.20sENTRIES where queueName='%s'",. 

Definition at line 975 of file SQLiteQueue.c.
References ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getDbInfo(), ExceptionStruct::message, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, SNPRINTF, strncpy0(), strToInt64(), and XB_ENTRIES_DATA_ID.
Referenced by fillCache().
Here is the call graph for this function:

IMAGE
static int parseQueueEntryArr (I_Queue * queueP, size_t currIndex, void * userP, char ** pazValue, char ** pazColName, ExceptionStruct * exception) [static]
For each SQL result row parse it into a QueueEntry. 

No parameters are checked, they must be valid Implements a ParseDataFp (function pointer) 
Parameters:
queueP The 'this' pointer 
currIndex 
userP 
pazValue 
pazColName 
exception The exception is set to *exception->errorCode==0 on success, else to != 0 
Returns:
false on error and exception->errorCode is not null 

Definition at line 596 of file SQLiteQueue.c.
References TmpHelper::currBytes, TmpHelper::currEntries, BlobHolder::data, BlobHolder::dataLen, QueueEntry::embeddedBlob, QueueEntry::embeddedType, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, int64Str, int64ToStr(), QueueEntry::isPersistent, QueueEntryStructArr::len, LOG, TmpHelper::maxNumOfBytes, TmpHelper::maxNumOfEntries, ExceptionStruct::message, QueueEntry::priority, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, QueueEntryStructArr::queueEntryArr, TmpHelper::queueEntryArrPP, SNPRINTF, strncpy0(), strToInt64(), QueueEntry::uniqueId, XB_ENTRIES_BLOB, XB_ENTRIES_DATA_ID, XB_ENTRIES_PERSISTENT, XB_ENTRIES_PRIO, XB_ENTRIES_SIZE_IN_BYTES, and XB_ENTRIES_TYPE_NAME.
Referenced by persistentQueuePeekWithSamePriority().
Here is the call graph for this function:

IMAGE
static int persistentQueueClear (I_Queue * queueP, ExceptionStruct * exception) [static]
Destroy all entries in queue. 

Definition at line 946 of file SQLiteQueue.c.
References checkArgs(), compilePreparedQuery(), getDbInfo(), getResultRows(), LEN256, LOG, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, DbInfoStruct::prop, SNPRINTF, and QueueProperties::tablePrefix.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int persistentQueueDestroy (I_Queue ** queuePP, ExceptionStruct * exception) [static]
Destroy all entries in queue and releases all resources in memory and on HD. 

Definition at line 919 of file SQLiteQueue.c.
References checkArgs(), QueueProperties::dbName, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, freeQueue(), getDbInfo(), ExceptionStruct::message, DbInfoStruct::prop, shutdownInternal(), SNPRINTF, and strncpy0().
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int persistentQueueEmpty (I_Queue * queueP) [static]

Definition at line 1037 of file SQLiteQueue.c.
References getNumOfEntries().
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int persistentQueueInitialize (I_Queue * queueP, QueueProperties * queueProperties, ExceptionStruct * exception) [static]
Called internally by createQueue(). 

Parameters:
queueP The this pointer 
queueProperties The configuration 
exception Can contain error information (out parameter) 
Returns:
true on success 

Definition at line 236 of file SQLiteQueue.c.
References checkArgs(), createTables(), DbInfoStruct::db, QueueProperties::dbName, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, fillCache(), getDbInfo(), I_QueueStruct::isInitialized, LOG, I_QueueStruct::log, QueueProperties::logFp, QueueProperties::logLevel, I_QueueStruct::logLevel, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, ExceptionStruct::message, DbInfoStruct::prop, QUEUE_DBNAME_MAX, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueProperties::queueName, SNPRINTF, strncpy0(), QueueProperties::tablePrefix, QueueProperties::userObject, and I_QueueStruct::userObject.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static QueueEntryArr * persistentQueuePeekWithSamePriority (I_Queue * queueP, int32_t maxNumOfEntries, int64_t maxNumOfBytes, ExceptionStruct * exception) [static]
Access queue entries without removing them. 

Definition at line 779 of file SQLiteQueue.c.
References checkArgs(), compilePreparedQuery(), ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getDbInfo(), getResultRows(), int64Str, int64ToStr(), QueueEntryStructArr::len, LEN512, LOG, TmpHelper::maxNumOfBytes, TmpHelper::maxNumOfEntries, ExceptionStruct::message, parseQueueEntryArr(), DbInfoStruct::prop, DbInfoStruct::pVm_peekWithSamePriority, QueueEntryStructArr::queueEntryArr, TmpHelper::queueEntryArrPP, QueueProperties::queueName, SNPRINTF, strncpy0(), and QueueProperties::tablePrefix.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static void persistentQueuePut (I_Queue * queueP, QueueEntry * queueEntry, ExceptionStruct * exception) [static]

Parameters:
queueP The queue instance 

Parameters:
queueEntry The entry 
exception The exception is set to *exception->errorCode==0 on success, else to != 0 

< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL
< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL
< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL 

Definition at line 423 of file SQLiteQueue.c.
References checkArgs(), compilePreparedQuery(), BlobHolder::data, BlobHolder::dataLen, QueueEntry::embeddedBlob, QueueEntry::embeddedType, ExceptionStruct::errorCode, EXCEPTIONSTRUCT_ERRORCODE_LEN, EXCEPTIONSTRUCT_MESSAGE_LEN, getDbInfo(), getResultRows(), INT64_STRLEN_MAX, int64Str, int64ToStr(), QueueEntry::isPersistent, LEN256, LOG, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, ExceptionStruct::message, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, QueueEntry::priority, DbInfoStruct::prop, DbInfoStruct::pVm_put, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, QueueProperties::queueName, QueueEntry::sizeInBytes, SNPRINTF, strncpy0(), QueueProperties::tablePrefix, and QueueEntry::uniqueId.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static int32_t persistentQueueRandomRemove (I_Queue * queueP, QueueEntryArr * queueEntryArr, ExceptionStruct * exception) [static]
Removes the given entries from persistence. 

Returns:
The number of removed entries 

< Size of a max int64_t dumped to a string including an optional LL and termination '': LLONG_MAX from limits.h 9223372036854775807LL 

Definition at line 860 of file SQLiteQueue.c.
References checkArgs(), compilePreparedQuery(), BlobHolder::dataLen, DbInfoStruct::db, QueueEntry::embeddedBlob, fillCache(), getDbInfo(), getResultRows(), ID_MAX, INT64_STRLEN_MAX, int64Str, int64ToStr(), QueueEntryStructArr::len, LOG, DbInfoStruct::numOfBytes, DbInfoStruct::numOfEntries, DbInfoStruct::prop, QueueEntryStructArr::queueEntryArr, QueueProperties::queueName, QueueEntry::sizeInBytes, SNPRINTF, QueueProperties::tablePrefix, and QueueEntry::uniqueId.
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
static void persistentQueueShutdown (I_Queue ** queuePP, ExceptionStruct * exception) [static]
Shutdown without destroying any entry. 

Clears all open DB resources. 

Definition at line 1090 of file SQLiteQueue.c.
References checkArgs(), freeQueue(), and shutdownInternal().
Referenced by createQueue().
Here is the call graph for this function:

IMAGE
char* queueEntryToXml (QueueEntry * queueEntry, int maxContentDumpLen)
NOTE: You need to free the returned pointer with freeEntryDump() (which calls free())! 

Parameters:
queueEntry The data to put to the queue 
maxContentDumpLen for -1 get the complete content, else limit the content to the given number of bytes 
Returns:
A ASCII XML formatted entry or NULL if out of memory 

Definition at line 1194 of file SQLiteQueue.c.
References BlobHolder::data, BlobHolder::dataLen, QueueEntry::embeddedBlob, QueueEntry::embeddedType, int64Str, int64ToStr(), QueueEntry::isPersistent, QueueEntry::priority, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, SNPRINTF, strFromBlobAlloc(), and QueueEntry::uniqueId.
Referenced by test_queue().
Here is the call graph for this function:

IMAGE
static void shutdownInternal (I_Queue ** queuePP, ExceptionStruct * exception) [static]
Shutdown used internally without calling freeQueue(). 

Definition at line 1101 of file SQLiteQueue.c.
References checkArgs(), DbInfoStruct::db, getDbInfo(), LOG, DbInfoStruct::pVm_fillCache, DbInfoStruct::pVm_peekWithSamePriority, and DbInfoStruct::pVm_put.
Referenced by persistentQueueDestroy(), and persistentQueueShutdown().
Here is the call graph for this function:

IMAGE

Variable Documentation
char* int64Str = int64Str_ [static]

Definition at line 130 of file SQLiteQueue.c.
Referenced by fillCache(), parseQueueEntryArr(), persistentQueuePeekWithSamePriority(), persistentQueuePut(), persistentQueueRandomRemove(), queueEntryToXml(), test_overflow(), and test_queue().char int64Str_[22] [static]

Definition at line 129 of file SQLiteQueue.c.

XmlBlasterAccessUnparsed.h File Reference
#include <util/msgUtil.h>
#include <util/Properties.h>
#include <XmlBlasterConnectionUnparsed.h>
#include <CallbackServerUnparsed.h>
#include <pthread.h>

Include dependency graph for XmlBlasterAccessUnparsed.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterAccessUnparsed
All client access to xmlBlaster goes over this struct and its function pointers. 

Typedefs
typedef int(*) UpdateFp (MsgUnitArr *msg, void *userData, XmlBlasterException *xmlBlasterException)
typedef char *(*) XmlBlasterAccessUnparsedConnect (struct XmlBlasterAccessUnparsed *xb, const char *const qos, UpdateFp update, XmlBlasterException *exception)
typedef int(*) XmlBlasterAccessUnparsedInitialize (struct XmlBlasterAccessUnparsed *xa, UpdateFp update, XmlBlasterException *exception)
typedef int(*) XmlBlasterAccessUnparsedDisconnect (struct XmlBlasterAccessUnparsed *xb, const char *qos, XmlBlasterException *exception)
typedef char *(*) XmlBlasterAccessUnparsedPublish (struct XmlBlasterAccessUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterAccessUnparsedPublishArr (struct XmlBlasterAccessUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
typedef void(*) XmlBlasterAccessUnparsedPublishOneway (struct XmlBlasterAccessUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
typedef char *(*) XmlBlasterAccessUnparsedSubscribe (struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterAccessUnparsedUnSubscribe (struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterAccessUnparsedErase (struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef MsgUnitArr *(*) XmlBlasterAccessUnparsedGet (struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef char *(*) XmlBlasterAccessUnparsedPing (struct XmlBlasterAccessUnparsed *xb, const char *const qos, XmlBlasterException *exception)
typedef int(*) XmlBlasterAccessUnparsedIsConnected (struct XmlBlasterAccessUnparsed *xb)
typedef void(*) XmlBlasterAccessGenericFp ()
Functions
XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsed (int argc, const char *const *argv)
Create an instance to access xmlBlaster. 

void freeXmlBlasterAccessUnparsed (XmlBlasterAccessUnparsed *xmlBlasterAccess)
Free your instance after accessing xmlBlaster. 

const char * xmlBlasterAccessUnparsedUsage (char *usage)
Help usage. 

Typedef Documentation
typedef int(*) UpdateFp(MsgUnitArr *msg, void *userData, XmlBlasterException *xmlBlasterException)

Definition at line 82 of file XmlBlasterAccessUnparsed.h.typedef void( * ) XmlBlasterAccessGenericFp()

Definition at line 98 of file XmlBlasterAccessUnparsed.h.typedef char*( * ) XmlBlasterAccessUnparsedConnect(struct XmlBlasterAccessUnparsed *xb, const char *const qos, UpdateFp update, XmlBlasterException *exception)

Definition at line 85 of file XmlBlasterAccessUnparsed.h.typedef int( * ) XmlBlasterAccessUnparsedDisconnect(struct XmlBlasterAccessUnparsed *xb, const char *qos, XmlBlasterException *exception)

Definition at line 87 of file XmlBlasterAccessUnparsed.h.typedef QosArr*( * ) XmlBlasterAccessUnparsedErase(struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 93 of file XmlBlasterAccessUnparsed.h.typedef MsgUnitArr*( * ) XmlBlasterAccessUnparsedGet(struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 94 of file XmlBlasterAccessUnparsed.h.typedef int( * ) XmlBlasterAccessUnparsedInitialize(struct XmlBlasterAccessUnparsed *xa, UpdateFp update, XmlBlasterException *exception)

Definition at line 86 of file XmlBlasterAccessUnparsed.h.typedef int( * ) XmlBlasterAccessUnparsedIsConnected(struct XmlBlasterAccessUnparsed *xb)

Definition at line 96 of file XmlBlasterAccessUnparsed.h.typedef char*( * ) XmlBlasterAccessUnparsedPing(struct XmlBlasterAccessUnparsed *xb, const char *const qos, XmlBlasterException *exception)

Definition at line 95 of file XmlBlasterAccessUnparsed.h.typedef char*( * ) XmlBlasterAccessUnparsedPublish(struct XmlBlasterAccessUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception)

Definition at line 88 of file XmlBlasterAccessUnparsed.h.typedef QosArr*( * ) XmlBlasterAccessUnparsedPublishArr(struct XmlBlasterAccessUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)

Definition at line 89 of file XmlBlasterAccessUnparsed.h.typedef void( * ) XmlBlasterAccessUnparsedPublishOneway(struct XmlBlasterAccessUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)

Definition at line 90 of file XmlBlasterAccessUnparsed.h.typedef char*( * ) XmlBlasterAccessUnparsedSubscribe(struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 91 of file XmlBlasterAccessUnparsed.h.typedef QosArr*( * ) XmlBlasterAccessUnparsedUnSubscribe(struct XmlBlasterAccessUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 92 of file XmlBlasterAccessUnparsed.h.
Function Documentation
void freeXmlBlasterAccessUnparsed (XmlBlasterAccessUnparsed * xmlBlasterAccess)
Free your instance after accessing xmlBlaster. 

Definition at line 136 of file XmlBlasterAccessUnparsed.c.
References XmlBlasterAccessUnparsed::callbackP, XmlBlasterAccessUnparsed::callbackThreadId, XmlBlasterAccessUnparsed::connectionP, freeCallbackServerUnparsed(), freeProperties(), freeXmlBlasterConnectionUnparsed(), get_pthread_id(), PropertiesStruct::getBool, getStackTrace(), XmlBlasterAccessUnparsed::isShutdown, CallbackServerUnparsedStruct::isShutdown, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, XmlBlasterAccessUnparsed::props, XmlBlasterAccessUnparsed::readnMutex, CallbackServerUnparsedStruct::shutdown, XmlBlasterConnectionUnparsedStruct::shutdown, sleepMillis(), XmlBlasterAccessUnparsed::threadCounter, XmlBlasterAccessUnparsed::writenMutex, XMLBLASTER_LOG_ERROR, XMLBLASTER_LOG_INFO, XMLBLASTER_LOG_TRACE, and XMLBLASTER_LOG_WARN.
Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), main(), and myUpdate().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsed (int argc, const char *const * argv)
Create an instance to access xmlBlaster. 

This is usually the first call of a client.
Every call creates a new and independent client access instance to xmlBlaster
Our properties point on the passed argv memory, so you should not free the original argv memory before you free XmlBlasterAccessUnparsed.
Parameters:
argc The number of argv properties 
argv The command line properties, see createProperties() for a specification, can be NULL for argc==0 
Returns:
NULL if bootstrapping failed. If not NULL you need to free memory when you are done usually by calling freeXmlBlasterAccessUnparsed(). 

Referenced by getXmlBlasterAccessUnparsedUnmanaged(), getXmlBlasterAccessUnparsedUnmanagedCE(), and main().const char* xmlBlasterAccessUnparsedUsage (char * usage)
Help usage. 

Parameters:
usage Please pass a string with at least XMLBLASTER_MAX_USAGE_LEN chars allocated (or on stack) 
Returns:
Your usage pointer filled with informations 

Definition at line 605 of file XmlBlasterAccessUnparsed.c.
References callbackServerRawUsage(), SNPRINTF, XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterConnectionUnparsedUsage().
Referenced by main(), xmlBlasterUnmanagedCEUsage(), and xmlBlasterUnmanagedUsage().
Here is the call graph for this function:

IMAGE

XmlBlasterConnectionUnparsed.h File Reference
#include <util/msgUtil.h>
#include <util/queue/QueueInterface.h>
#include <util/Properties.h>

Include dependency graph for XmlBlasterConnectionUnparsed.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterConnectionUnparsedStruct
All synchrnous client access to xmlBlaster goes over this struct and its function pointers. 

Typedefs
typedef XmlBlasterConnectionUnparsedStruct XmlBlasterConnectionUnparsed
typedef int(*) XmlBlasterConnectionUnparsedInitConnection (XmlBlasterConnectionUnparsed *xb, XmlBlasterException *exception)
typedef int(*) XmlBlasterConnectionUnparsedInitQueue (XmlBlasterConnectionUnparsed *xb, QueueProperties *queueProperties, XmlBlasterException *exception)
typedef char *(*) XmlBlasterConnectionUnparsedConnect (XmlBlasterConnectionUnparsed *xb, const char *const qos, XmlBlasterException *exception)
typedef int(*) XmlBlasterConnectionUnparsedDisconnect (XmlBlasterConnectionUnparsed *xb, const char *qos, XmlBlasterException *exception)
typedef char *(*) XmlBlasterConnectionUnparsedPublish (XmlBlasterConnectionUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterConnectionUnparsedPublishArr (XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
typedef void(*) XmlBlasterConnectionUnparsedPublishOneway (XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)
typedef char *(*) XmlBlasterConnectionUnparsedSubscribe (XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterConnectionUnparsedUnSubscribe (XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef QosArr *(*) XmlBlasterConnectionUnparsedErase (XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef MsgUnitArr *(*) XmlBlasterConnectionUnparsedGet (XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)
typedef char *(*) XmlBlasterConnectionUnparsedPing (XmlBlasterConnectionUnparsed *xb, const char *const qos, XmlBlasterException *exception)
typedef int(*) XmlBlasterConnectionUnparsedIsConnected (XmlBlasterConnectionUnparsed *xb)
typedef void(*) XmlBlasterConnectionUnparsedShutdown (XmlBlasterConnectionUnparsed *xb)
typedef MsgRequestInfo *(*) XmlBlasterConnectionUnparsedPreSendEvent (MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception)
typedef MsgRequestInfo *(*) XmlBlasterConnectionUnparsedPostSendEvent (MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception)
Functions
XmlBlasterConnectionUnparsed * getXmlBlasterConnectionUnparsed (int argc, const char *const *argv)
Get an instance of this to get xmlBlaster access. 

void freeXmlBlasterConnectionUnparsed (XmlBlasterConnectionUnparsed **xmlBlasterAccess)
Free your instance after accessing xmlBlaster. 

const char * xmlBlasterConnectionUnparsedUsage ()
Help usage. 

Typedef Documentation
typedef struct XmlBlasterConnectionUnparsedStruct XmlBlasterConnectionUnparsed

Definition at line 29 of file XmlBlasterConnectionUnparsed.h.typedef char*( * ) XmlBlasterConnectionUnparsedConnect(XmlBlasterConnectionUnparsed *xb, const char *const qos, XmlBlasterException *exception)

Definition at line 34 of file XmlBlasterConnectionUnparsed.h.typedef int( * ) XmlBlasterConnectionUnparsedDisconnect(XmlBlasterConnectionUnparsed *xb, const char *qos, XmlBlasterException *exception)

Definition at line 35 of file XmlBlasterConnectionUnparsed.h.typedef QosArr*( * ) XmlBlasterConnectionUnparsedErase(XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 41 of file XmlBlasterConnectionUnparsed.h.typedef MsgUnitArr*( * ) XmlBlasterConnectionUnparsedGet(XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 42 of file XmlBlasterConnectionUnparsed.h.typedef int( * ) XmlBlasterConnectionUnparsedInitConnection(XmlBlasterConnectionUnparsed *xb, XmlBlasterException *exception)

Definition at line 32 of file XmlBlasterConnectionUnparsed.h.typedef int( * ) XmlBlasterConnectionUnparsedInitQueue(XmlBlasterConnectionUnparsed *xb, QueueProperties *queueProperties, XmlBlasterException *exception)

Definition at line 33 of file XmlBlasterConnectionUnparsed.h.typedef int( * ) XmlBlasterConnectionUnparsedIsConnected(XmlBlasterConnectionUnparsed *xb)

Definition at line 44 of file XmlBlasterConnectionUnparsed.h.typedef char*( * ) XmlBlasterConnectionUnparsedPing(XmlBlasterConnectionUnparsed *xb, const char *const qos, XmlBlasterException *exception)

Definition at line 43 of file XmlBlasterConnectionUnparsed.h.typedef MsgRequestInfo*( * ) XmlBlasterConnectionUnparsedPostSendEvent(MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception)

Definition at line 47 of file XmlBlasterConnectionUnparsed.h.typedef MsgRequestInfo*( * ) XmlBlasterConnectionUnparsedPreSendEvent(MsgRequestInfo *msgRequestInfo, XmlBlasterException *exception)

Definition at line 46 of file XmlBlasterConnectionUnparsed.h.typedef char*( * ) XmlBlasterConnectionUnparsedPublish(XmlBlasterConnectionUnparsed *xb, MsgUnit *msgUnit, XmlBlasterException *exception)

Definition at line 36 of file XmlBlasterConnectionUnparsed.h.typedef QosArr*( * ) XmlBlasterConnectionUnparsedPublishArr(XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)

Definition at line 37 of file XmlBlasterConnectionUnparsed.h.typedef void( * ) XmlBlasterConnectionUnparsedPublishOneway(XmlBlasterConnectionUnparsed *xb, MsgUnitArr *msgUnitArr, XmlBlasterException *exception)

Definition at line 38 of file XmlBlasterConnectionUnparsed.h.typedef void( * ) XmlBlasterConnectionUnparsedShutdown(XmlBlasterConnectionUnparsed *xb)

Definition at line 45 of file XmlBlasterConnectionUnparsed.h.typedef char*( * ) XmlBlasterConnectionUnparsedSubscribe(XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 39 of file XmlBlasterConnectionUnparsed.h.typedef QosArr*( * ) XmlBlasterConnectionUnparsedUnSubscribe(XmlBlasterConnectionUnparsed *xb, const char *const key, const char *qos, XmlBlasterException *exception)

Definition at line 40 of file XmlBlasterConnectionUnparsed.h.
Function Documentation
void freeXmlBlasterConnectionUnparsed (XmlBlasterConnectionUnparsed ** xmlBlasterAccess)
Free your instance after accessing xmlBlaster. 

After freeing *xmlBlasterAccess is set to null Call example: freeXmlBlasterConnectionUnparsed(&xa->connectionP); 

Definition at line 105 of file XmlBlasterConnectionUnparsed.c.
References freeProperties(), XmlBlasterConnectionUnparsedStruct::log, XmlBlasterConnectionUnparsedStruct::logLevel, XmlBlasterConnectionUnparsedStruct::logUserP, XmlBlasterConnectionUnparsedStruct::props, xmlBlaster_endZlibReader(), xmlBlaster_endZlibWriter(), XMLBLASTER_LOG_TRACE, xmlBlasterConnectionShutdown(), XmlBlasterConnectionUnparsedStruct::zlibReadBuf, and XmlBlasterConnectionUnparsedStruct::zlibWriteBuf.
Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterConnectionUnparsed(), and initialize().
Here is the call graph for this function:

IMAGE
XmlBlasterConnectionUnparsed* getXmlBlasterConnectionUnparsed (int argc, const char *const * argv)
Get an instance of this to get xmlBlaster access. 

Every call creates a new and independent client access instance to xmlBlaster 

Referenced by initialize().const char* xmlBlasterConnectionUnparsedUsage ()
Help usage. 

Definition at line 514 of file XmlBlasterConnectionUnparsed.c.
References strncat0(), and strncpy0().
Referenced by xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE

XmlBlasterManaged.cpp File Reference

XmlBlasterManaged.h File Reference

XmlBlasterUnmanaged.h File Reference
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for XmlBlasterUnmanaged.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterUnmanagedException
Usage without fixed array size, to avoid 'unsafe' code in C#. 

struct XmlBlasterUnmanagedStringArr
Helper struct to pass an array of strings back to C#. 

Typedefs
typedef const char *(*) XmlBlasterUnmanagedUpdateFp (const char *cbSessionId, const char *key, char *contentStr, int32_t contentLen, const char *qos, XmlBlasterUnmanagedException *xmlBlasterException)
Functions
XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsedUnmanaged (int argc, const char *const *argv)
void freeXmlBlasterAccessUnparsedUnmanaged (XmlBlasterAccessUnparsed *xmlBlasterAccess)
char * xmlBlasterUnmanagedConnect (struct XmlBlasterAccessUnparsed *xa, const char *const qos, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException *exception)
int xmlBlasterUnmanagedInitialize (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException *exception)
int xmlBlasterUnmanagedDisconnect (struct XmlBlasterAccessUnparsed *xa, const char *qos, XmlBlasterUnmanagedException *exception)
char * xmlBlasterUnmanagedPublish (struct XmlBlasterAccessUnparsed *xa, MsgUnit *msgUnit, XmlBlasterUnmanagedException *exception)
QosArr * xmlBlasterUnmanagedPublishArr (struct XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterUnmanagedException *exception)
void xmlBlasterUnmanagedPublishOneway (struct XmlBlasterAccessUnparsed *xa, MsgUnit *msgUnitArr, int length, XmlBlasterUnmanagedException *exception)
char * xmlBlasterUnmanagedSubscribe (struct XmlBlasterAccessUnparsed *xa, const char *const key, const char *qos, XmlBlasterUnmanagedException *exception)
void xmlBlasterUnmanagedUnSubscribe (struct XmlBlasterAccessUnparsed *xa, const char *const key, const char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, XmlBlasterUnmanagedStringArr **ppStruct)
void xmlBlasterUnmanagedErase (struct XmlBlasterAccessUnparsed *xa, const char *const key, const char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, XmlBlasterUnmanagedStringArr **ppStruct)
void xmlBlasterUnmanagedGet (struct XmlBlasterAccessUnparsed *xa, const char *const key, const char *qos, XmlBlasterUnmanagedException *exception, uint32_t *pSize, MsgUnit **ppStruct)
char * xmlBlasterUnmanagedPing (struct XmlBlasterAccessUnparsed *xa, const char *const qos, XmlBlasterUnmanagedException *exception)
int xmlBlasterUnmanagedIsConnected (struct XmlBlasterAccessUnparsed *xa)
const char * xmlBlasterUnmanagedUsage ()

Typedef Documentation
typedef const char*(*) XmlBlasterUnmanagedUpdateFp(const char *cbSessionId, const char *key, char *contentStr, int32_t contentLen, const char *qos, XmlBlasterUnmanagedException *xmlBlasterException)

Definition at line 50 of file XmlBlasterUnmanaged.h.
Function Documentation
void freeXmlBlasterAccessUnparsedUnmanaged (XmlBlasterAccessUnparsed * xmlBlasterAccess)

Definition at line 97 of file XmlBlasterUnmanaged.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, and freeXmlBlasterAccessUnparsed().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsedUnmanaged (int argc, const char *const * argv)
char* xmlBlasterUnmanagedConnect (struct XmlBlasterAccessUnparsed * xa, const char *const qos, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException * exception)
int xmlBlasterUnmanagedDisconnect (struct XmlBlasterAccessUnparsed * xa, const char * qos, XmlBlasterUnmanagedException * exception)
void xmlBlasterUnmanagedErase (struct XmlBlasterAccessUnparsed * xa, const char *const key, const char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, XmlBlasterUnmanagedStringArr ** ppStruct)
void xmlBlasterUnmanagedGet (struct XmlBlasterAccessUnparsed * xa, const char *const key, const char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, MsgUnit ** ppStruct)
int xmlBlasterUnmanagedInitialize (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedUpdateFp update, XmlBlasterUnmanagedException * exception)

Definition at line 107 of file XmlBlasterUnmanaged.c.
References convert(), XmlBlasterAccessUnparsed::initialize, interceptUpdate(), and XmlBlasterAccessUnparsed::userFp.
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedIsConnected (struct XmlBlasterAccessUnparsed * xa)

Definition at line 253 of file XmlBlasterUnmanaged.c.
References XmlBlasterAccessUnparsed::isConnected.char* xmlBlasterUnmanagedPing (struct XmlBlasterAccessUnparsed * xa, const char *const qos, XmlBlasterUnmanagedException * exception)
char* xmlBlasterUnmanagedPublish (struct XmlBlasterAccessUnparsed * xa, MsgUnit * msgUnit, XmlBlasterUnmanagedException * exception)

Definition at line 133 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::publish.
Here is the call graph for this function:

IMAGE
QosArr* xmlBlasterUnmanagedPublishArr (struct XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterUnmanagedException * exception)

Definition at line 140 of file XmlBlasterUnmanaged.c.
References convert(), and XmlBlasterAccessUnparsed::publishArr.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedPublishOneway (struct XmlBlasterAccessUnparsed * xa, MsgUnit * msgUnitArr, int length, XmlBlasterUnmanagedException * exception)

Definition at line 147 of file XmlBlasterUnmanaged.c.
References convert(), MsgUnitStructArr::isOneway, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, XmlBlasterAccessUnparsed::publishOneway, and MsgUnitStructArr::secretSessionId.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedSubscribe (struct XmlBlasterAccessUnparsed * xa, const char *const key, const char * qos, XmlBlasterUnmanagedException * exception)
void xmlBlasterUnmanagedUnSubscribe (struct XmlBlasterAccessUnparsed * xa, const char *const key, const char * qos, XmlBlasterUnmanagedException * exception, uint32_t * pSize, XmlBlasterUnmanagedStringArr ** ppStruct)
const char* xmlBlasterUnmanagedUsage ()

Definition at line 257 of file XmlBlasterUnmanaged.c.
References XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE

XmlBlasterUnmanagedCE.h File Reference
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for XmlBlasterUnmanagedCE.h:

IMAGE

This graph shows which files directly or indirectly include this file:

IMAGE

Data Structures
struct XmlBlasterUnmanagedCEException
Usage without fixed array size, to avoid 'unsafe' code in C#. 

struct XmlBlasterUnmanagedCEStringArr
Helper struct to pass an array of strings back to C#. 

Defines
#define XB_CALLBACK_DECL
Typedefs
typedef MsgUnit MsgUnitUnmanagedCEpublish
typedef MsgUnit MsgUnitUnmanagedCEget
typedef void(*) XmlBlasterUnmanagedCELoggerFp (int32_t level, const char *location, const char *msg)
typedef void(*) XmlBlasterUnmanagedCEUpdateFp (const char *cbSessionId, MsgUnit *msgUnit, int32_t isOneway, XmlBlasterUnmanagedCEException *xmlBlasterException)
typedef void(*) XmlBlasterUnmanagedCECallbackProgressListenerFp (int32_t currBytesRead, int32_t nbytes)
typedef int32_t(*) FPTR (int32_t i)
Functions
char * xmlBlasterUnmanagedCEMalloc (int32_t size)
malloc size bytes 

void xmlBlasterUnmanagedCEFree (char *p)
Frees the malloced pointer. 

void xmlBlasterUnmanagedCEFreePP (char **pp)
Frees the content of the malloced pointer It is a hack as i don't know how to free the IntPtr which arrived as ** and was allocated on (*ppStruct) for example in unSubscribe(): So we call this function similar as the unSubscribe() . 

void xmlBlasterUnmanagedCEExceptionFree (XmlBlasterUnmanagedCEException *exception)
const char * getXmlBlasterEmei ()
You need to add cellcore.lib for compilation (WINCE). 

void xmlBlasterUnmanagedCERegisterLogger (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCELoggerFp logger)
void xmlBlasterUnmanagedCERegisterProgressListener (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCECallbackProgressListenerFp progressListener)
Called by managed C# code to register for progress notifications. 

XmlBlasterAccessUnparsed * getXmlBlasterAccessUnparsedUnmanagedCE (int argc, char **argv)
void freeXmlBlasterAccessUnparsedUnmanagedCE (XmlBlasterAccessUnparsed *xmlBlasterAccess)
char * xmlBlasterUnmanagedCEConnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException *exception)
Your qos is freed. 

int xmlBlasterUnmanagedCEInitialize (struct XmlBlasterAccessUnparsed *xa, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException *exception)
int xmlBlasterUnmanagedCEDisconnect (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEException *exception)
Your qos is freed. 

char * xmlBlasterUnmanagedCEPublish (struct XmlBlasterAccessUnparsed *xa, MsgUnitUnmanagedCEpublish *msgUnit, XmlBlasterUnmanagedCEException *exception)
QosArr * xmlBlasterUnmanagedCEPublishArr (struct XmlBlasterAccessUnparsed *xa, MsgUnitArr *msgUnitArr, XmlBlasterUnmanagedCEException *exception)
void xmlBlasterUnmanagedCEPublishOneway (struct XmlBlasterAccessUnparsed *xa, void *msgUnitArr, int length, XmlBlasterUnmanagedCEException *exception)
char * xmlBlasterUnmanagedCESubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception)
Your key and qos is freed. 

void xmlBlasterUnmanagedCEUnSubscribe (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, XmlBlasterUnmanagedCEStringArr **ppStruct)
void xmlBlasterUnmanagedCEErase (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, XmlBlasterUnmanagedCEStringArr **ppStruct)
void xmlBlasterUnmanagedCEGet (struct XmlBlasterAccessUnparsed *xa, char *key, char *qos, XmlBlasterUnmanagedCEException *exception, uint32_t *pSize, MsgUnitUnmanagedCEget **ppStruct)
char * xmlBlasterUnmanagedCEPing (struct XmlBlasterAccessUnparsed *xa, char *qos, XmlBlasterUnmanagedCEException *exception)
int xmlBlasterUnmanagedCEIsConnected (struct XmlBlasterAccessUnparsed *xa)
const char * xmlBlasterUnmanagedCEVersion ()
const char * xmlBlasterUnmanagedCEUsage ()

Define Documentation
#define XB_CALLBACK_DECL

Definition at line 84 of file XmlBlasterUnmanagedCE.h.
Typedef Documentation
typedef int32_t( *) FPTR(int32_t i)

Definition at line 90 of file XmlBlasterUnmanagedCE.h.typedef MsgUnit MsgUnitUnmanagedCEget

Definition at line 60 of file XmlBlasterUnmanagedCE.h.typedef MsgUnit MsgUnitUnmanagedCEpublish

Definition at line 59 of file XmlBlasterUnmanagedCE.h.typedef void( *) XmlBlasterUnmanagedCECallbackProgressListenerFp(int32_t currBytesRead, int32_t nbytes)

Definition at line 88 of file XmlBlasterUnmanagedCE.h.typedef void( *) XmlBlasterUnmanagedCELoggerFp(int32_t level, const char *location, const char *msg)

Definition at line 86 of file XmlBlasterUnmanagedCE.h.typedef void( *) XmlBlasterUnmanagedCEUpdateFp(const char *cbSessionId, MsgUnit *msgUnit, int32_t isOneway, XmlBlasterUnmanagedCEException *xmlBlasterException)

Definition at line 87 of file XmlBlasterUnmanagedCE.h.
Function Documentation
void freeXmlBlasterAccessUnparsedUnmanagedCE (XmlBlasterAccessUnparsed * xmlBlasterAccess)

Definition at line 293 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::argc, XmlBlasterAccessUnparsed::argv, and freeXmlBlasterAccessUnparsed().
Here is the call graph for this function:

IMAGE
XmlBlasterAccessUnparsed* getXmlBlasterAccessUnparsedUnmanagedCE (int argc, char ** argv)

Definition at line 278 of file XmlBlasterUnmanagedCE.c.
References getXmlBlasterAccessUnparsed(), and strcpyAlloc().
Here is the call graph for this function:

IMAGE
const char* getXmlBlasterEmei ()
You need to add cellcore.lib for compilation (WINCE). 

TODO: Not yet tested: What is inside the lineGeneralInfo.dwSerialNumberOffset?? TODO: Needs security model? 
Returns:
malloced string with IMEI, you need to free it 

Definition at line 572 of file XmlBlasterUnmanagedCE.c.char* xmlBlasterUnmanagedCEConnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException * exception)
Your qos is freed. 

Definition at line 316 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::connect, convert(), freeIt, interceptUpdate(), XmlBlasterAccessUnparsed::userFp, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEDisconnect (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEException * exception)
Your qos is freed. 

Definition at line 332 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::disconnect, freeIt, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEErase (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, XmlBlasterUnmanagedCEStringArr ** ppStruct)

Definition at line 417 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::erase, ExceptionStruct::errorCode, freeIt, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedCEStringArr::str, strcpyAlloc(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEExceptionFree (XmlBlasterUnmanagedCEException * exception)

Definition at line 197 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterUnmanagedCEException::errorCode, XmlBlasterUnmanagedCEException::message, XmlBlasterUnmanagedCEException::remote, and xmlBlasterFree().
Referenced by interceptUpdate().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEFree (char * p)
Frees the malloced pointer. 

Parameters:
p Can be null 

Definition at line 160 of file XmlBlasterUnmanagedCE.c.
References xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEFreePP (char ** pp)
Frees the content of the malloced pointer It is a hack as i don't know how to free the IntPtr which arrived as ** and was allocated on (*ppStruct) for example in unSubscribe(): So we call this function similar as the unSubscribe() . 

.. 
Parameters:
pp Can be null 

Definition at line 172 of file XmlBlasterUnmanagedCE.c.
References xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEGet (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, MsgUnitUnmanagedCEget ** ppStruct)

Definition at line 450 of file XmlBlasterUnmanagedCE.c.
References MsgUnit::content, MsgUnit::contentLen, convert(), ExceptionStruct::errorCode, freeIt, freeMsgUnitArr(), XmlBlasterAccessUnparsed::get, MsgUnit::key, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, MsgUnit::qos, MsgUnit::responseQos, strcpyAlloc(), and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEInitialize (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCEUpdateFp update, XmlBlasterUnmanagedCEException * exception)

Definition at line 303 of file XmlBlasterUnmanagedCE.c.
References convert(), XmlBlasterAccessUnparsed::initialize, interceptUpdate(), and XmlBlasterAccessUnparsed::userFp.
Here is the call graph for this function:

IMAGE
int xmlBlasterUnmanagedCEIsConnected (struct XmlBlasterAccessUnparsed * xa)

Definition at line 511 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::isConnected.char* xmlBlasterUnmanagedCEMalloc (int32_t size)
malloc size bytes 

Parameters:
size > 0 
Returns:
p the allocated pointer 

Definition at line 149 of file XmlBlasterUnmanagedCE.c.char* xmlBlasterUnmanagedCEPing (struct XmlBlasterAccessUnparsed * xa, char * qos, XmlBlasterUnmanagedCEException * exception)

Definition at line 503 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, XmlBlasterAccessUnparsed::ping, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCEPublish (struct XmlBlasterAccessUnparsed * xa, MsgUnitUnmanagedCEpublish * msgUnit, XmlBlasterUnmanagedCEException * exception)

Definition at line 341 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, freeMsgUnitData(), and XmlBlasterAccessUnparsed::publish.
Here is the call graph for this function:

IMAGE
QosArr* xmlBlasterUnmanagedCEPublishArr (struct XmlBlasterAccessUnparsed * xa, MsgUnitArr * msgUnitArr, XmlBlasterUnmanagedCEException * exception)

Definition at line 350 of file XmlBlasterUnmanagedCE.c.
References convert(), and XmlBlasterAccessUnparsed::publishArr.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEPublishOneway (struct XmlBlasterAccessUnparsed * xa, void * msgUnitArr, int length, XmlBlasterUnmanagedCEException * exception)

Definition at line 357 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, freeMsgUnitData(), MsgUnitStructArr::isOneway, MsgUnitStructArr::len, MsgUnitStructArr::msgUnitArr, XmlBlasterAccessUnparsed::publishOneway, and MsgUnitStructArr::secretSessionId.
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCERegisterLogger (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCELoggerFp logger)

Definition at line 91 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, and myLogger().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCERegisterProgressListener (struct XmlBlasterAccessUnparsed * xa, XmlBlasterUnmanagedCECallbackProgressListenerFp progressListener)
Called by managed C# code to register for progress notifications. 

Definition at line 128 of file XmlBlasterUnmanagedCE.c.
References XmlBlasterAccessUnparsed::callbackP, callbackProgressListener(), XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, and CallbackServerUnparsedStruct::readFromSocket.
Here is the call graph for this function:

IMAGE
char* xmlBlasterUnmanagedCESubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception)
Your key and qos is freed. 

Definition at line 379 of file XmlBlasterUnmanagedCE.c.
References convert(), freeIt, XmlBlasterAccessUnparsed::subscribe, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
void xmlBlasterUnmanagedCEUnSubscribe (struct XmlBlasterAccessUnparsed * xa, char * key, char * qos, XmlBlasterUnmanagedCEException * exception, uint32_t * pSize, XmlBlasterUnmanagedCEStringArr ** ppStruct)

Definition at line 388 of file XmlBlasterUnmanagedCE.c.
References convert(), ExceptionStruct::errorCode, freeIt, freeQosArr(), initializeXmlBlasterException(), QosStructArr::len, QosStructArr::qosArr, XmlBlasterUnmanagedCEStringArr::str, strcpyAlloc(), XmlBlasterAccessUnparsed::unSubscribe, and xmlBlasterFree().
Here is the call graph for this function:

IMAGE
const char* xmlBlasterUnmanagedCEUsage ()

Definition at line 515 of file XmlBlasterUnmanagedCE.c.
References XMLBLASTER_MAX_USAGE_LEN, and xmlBlasterAccessUnparsedUsage().
Here is the call graph for this function:

IMAGE
const char* xmlBlasterUnmanagedCEVersion ()

Definition at line 520 of file XmlBlasterUnmanagedCE.c.
References getXmlBlasterVersion(), and strcpyAlloc().
Here is the call graph for this function:

IMAGE

testsuite/src/c/TestQueue.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util/queue/QueueInterface.h>
#include "test.h"

Include dependency graph for TestQueue.c:

IMAGE

Defines
#define ERRORSTR_LEN  EXCEPTIONSTRUCT_ERRORCODE_LEN + EXCEPTIONSTRUCT_MESSAGE_LEN + 64
#define mu_assert_checkException(message, exception)
#define mu_assert_checkWantException(message, exception)
Functions
static int destroy (char *dbName)
Kill complete DB on HD. 

static char * test_illegal ()
Test illegal function call parameters. 

static char * test_overflow ()
Test overflow of maxNumOfBytes and maxNumOfEntries. 

static char * test_queue ()
Test invocation of all queue methods. 

static char * all_tests ()
int main (int argc_, char **argv_)
Variables
static int argc = 0
static char ** argv = 0
static char errorString [56+1024+64]
static char int64Str_ [32]
static char * int64Str = int64Str_
static char int64StrX_ [32]
static char * int64StrX = int64StrX_
static XmlBlasterLogging loggingFp = xmlBlasterDefaultLogging

Define Documentation
#define ERRORSTR_LEN  EXCEPTIONSTRUCT_ERRORCODE_LEN + EXCEPTIONSTRUCT_MESSAGE_LEN + 64

Definition at line 20 of file TestQueue.c.
Referenced by destroy().#define mu_assert_checkException(message, exception)
Value:do {\
         if (*exception.errorCode != 0) {\
            sprintf(MU_ASSERT_TEXT, "[TEST FAIL]%s:%d %s: Caught exception: '%s'", __FILE__, __LINE__, message, getExceptionStr(errorString, ERRORSTR_LEN, &exception));\
            return MU_ASSERT_TEXT;\
         }\
      } while (0)
Definition at line 29 of file TestQueue.c.
Referenced by test_illegal(), test_overflow(), and test_queue().#define mu_assert_checkWantException(message, exception)
Value:do {\
         if (*exception.errorCode == 0) {\
            sprintf(MU_ASSERT_TEXT, "[TEST FAIL]%s:%d %s: Missing exception", __FILE__, __LINE__, message);\
            return MU_ASSERT_TEXT;\
         }\
         else {\
            char out[1024];\
            printf("OK, expected exception: %s\n", getExceptionStr(out, 1024, &exception));\
         }\
      } while (0)
Definition at line 37 of file TestQueue.c.
Referenced by test_illegal(), and test_overflow().
Function Documentation
static char* all_tests () [static]

Definition at line 619 of file TestQueue.c.
References test_illegal(), test_overflow(), and test_queue().
Referenced by main().
Here is the call graph for this function:

IMAGE
static int destroy (char * dbName) [static]
Kill complete DB on HD. 

Definition at line 54 of file TestQueue.c.
References createQueue(), QueueProperties::dbName, I_QueueStruct::destroy, ERRORSTR_LEN, errorString, getExceptionStr(), QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, QUEUE_DBNAME_MAX, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueProperties::queueName, strncpy0(), and QueueProperties::tablePrefix.
Referenced by test_illegal(), test_overflow(), and test_queue().
Here is the call graph for this function:

IMAGE
int main (int argc_, char ** argv_)

Definition at line 627 of file TestQueue.c.
References all_tests(), argc, and argv.
Here is the call graph for this function:

IMAGE
static char* test_illegal () [static]
Test illegal function call parameters. 

Definition at line 80 of file TestQueue.c.
References I_QueueStruct::clear, createQueue(), QueueProperties::dbName, destroy(), I_QueueStruct::empty, freeQueueEntryArr(), I_QueueStruct::getNumOfBytes, I_QueueStruct::getNumOfEntries, QueueEntryStructArr::len, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, mu_assert_checkException, mu_assert_checkWantException, I_QueueStruct::peekWithSamePriority, I_QueueStruct::put, QUEUE_DBNAME_MAX, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueEntryStructArr::queueEntryArr, QueueProperties::queueName, I_QueueStruct::randomRemove, strncpy0(), and QueueProperties::tablePrefix.
Referenced by all_tests().
Here is the call graph for this function:

IMAGE
static char* test_overflow () [static]
Test overflow of maxNumOfBytes and maxNumOfEntries. 

Definition at line 181 of file TestQueue.c.
References createQueue(), QueueProperties::dbName, destroy(), I_QueueStruct::getMaxNumOfEntries, int64Str, int64StrX, int64ToStr(), QueueProperties::logFp, loggingFp, QueueProperties::logLevel, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, mu_assert_checkException, mu_assert_checkWantException, QUEUE_DBNAME_MAX, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueProperties::queueName, strncpy0(), QueueProperties::tablePrefix, QueueProperties::userObject, and XMLBLASTER_LOG_TRACE.
Referenced by all_tests().
Here is the call graph for this function:

IMAGE
static char* test_queue () [static]
Test invocation of all queue methods. 

Definition at line 314 of file TestQueue.c.
References createQueue(), BlobHolder::data, BlobHolder::dataLen, QueueProperties::dbName, destroy(), QueueEntry::embeddedBlob, freeEntryDump(), freeQueueEntryArr(), I_QueueStruct::getMaxNumOfEntries, I_QueueStruct::getProperties, int64Str, int64StrX, int64ToStr(), I_QueueStruct::isInitialized, QueueEntry::isPersistent, QueueEntryStructArr::len, QueueProperties::logFp, loggingFp, QueueProperties::logLevel, QueueProperties::maxNumOfBytes, QueueProperties::maxNumOfEntries, mu_assert_checkException, QueueEntry::priority, QUEUE_DBNAME_MAX, QUEUE_ENTRY_EMBEDDEDTYPE_LEN, QUEUE_ID_MAX, QUEUE_PREFIX_MAX, QueueEntryStructArr::queueEntryArr, queueEntryToXml(), QueueProperties::queueName, strFromBlobAlloc(), strncpy0(), QueueProperties::tablePrefix, QueueEntry::uniqueId, I_QueueStruct::userObject, QueueProperties::userObject, and XMLBLASTER_LOG_TRACE.
Referenced by all_tests().
Here is the call graph for this function:

IMAGE

Variable Documentation
int argc = 0 [static]

Definition at line 18 of file TestQueue.c.
Referenced by main().char** argv = 0 [static]

Definition at line 19 of file TestQueue.c.
Referenced by convertWcsArgv(), and main().char errorString[56+1024+64] [static]

Definition at line 21 of file TestQueue.c.
Referenced by destroy().char* int64Str = int64Str_ [static]

Definition at line 23 of file TestQueue.c.char int64Str_[32] [static]

Definition at line 22 of file TestQueue.c.char* int64StrX = int64StrX_ [static]

Definition at line 25 of file TestQueue.c.
Referenced by test_overflow(), and test_queue().char int64StrX_[32] [static]

Definition at line 24 of file TestQueue.c.XmlBlasterLogging loggingFp = xmlBlasterDefaultLogging [static]

Definition at line 27 of file TestQueue.c.
Referenced by test_overflow(), and test_queue().
XmlBlaster  C  Client  Library Page Documentation
Todo List
 Global XmlBlasterAccessUnparsed::clientsUpdateFp  
Return void instead of bool 

 Global getResultRows  
For INSERT and DELETE return the number of touched entries !!! 

Index
INDEX