#define JABBER_STATUS_BUFSIZE 16
// ---------------------------------------------------------------------------------
-// Callback for handling the startElement event. Much of the jabber logic occurs
-// in this and the characterHandler callbacks.
-// Here we check for the various top level jabber elements: body, iq, etc.
-// ---------------------------------------------------------------------------------
-void startElementHandler(
- void *session, const xmlChar *name, const xmlChar **atts);
-
-// ---------------------------------------------------------------------------------
-// Callback for handling the endElement event. Updates the Jabber state machine
-// to let us know the element is over.
-// ---------------------------------------------------------------------------------
-void endElementHandler( void *session, const xmlChar *name);
-
-// ---------------------------------------------------------------------------------
-// This is where we extract XML text content. In particular, this is useful for
-// extracting Jabber message bodies.
-// ---------------------------------------------------------------------------------
-void characterHandler(
- void *session, const xmlChar *ch, int len);
-
-void parseWarningHandler( void *session, const char* msg, ... );
-void parseErrorHandler( void *session, const char* msg, ... );
-
-// ---------------------------------------------------------------------------------
-// Tells the SAX parser which functions will be used as event callbacks
-// ---------------------------------------------------------------------------------
-static xmlSAXHandler SAXHandlerStruct = {
- NULL, /* internalSubset */
- NULL, /* isStandalone */
- NULL, /* hasInternalSubset */
- NULL, /* hasExternalSubset */
- NULL, /* resolveEntity */
- NULL, /* getEntity */
- NULL, /* entityDecl */
- NULL, /* notationDecl */
- NULL, /* attributeDecl */
- NULL, /* elementDecl */
- NULL, /* unparsedEntityDecl */
- NULL, /* setDocumentLocator */
- NULL, /* startDocument */
- NULL, /* endDocument */
- startElementHandler, /* startElement */
- endElementHandler, /* endElement */
- NULL, /* reference */
- characterHandler, /* characters */
- NULL, /* ignorableWhitespace */
- NULL, /* processingInstruction */
- NULL, /* comment */
- parseWarningHandler, /* xmlParserWarning */
- parseErrorHandler, /* xmlParserError */
- NULL, /* xmlParserFatalError : unused */
- NULL, /* getParameterEntity */
- NULL, /* cdataBlock; */
- NULL, /* externalSubset; */
- 1,
- NULL,
- NULL, /* startElementNs */
- NULL, /* endElementNs */
- NULL /* xmlStructuredErrorFunc */
-};
-
-// ---------------------------------------------------------------------------------
-// Our SAX handler pointer.
-// ---------------------------------------------------------------------------------
-static const xmlSAXHandlerPtr SAXHandler = &SAXHandlerStruct;
-
-// ---------------------------------------------------------------------------------
// Jabber state machine. This is how we know where we are in the Jabber
// conversation.
// ---------------------------------------------------------------------------------
#include <opensrf/transport_session.h>
+// ---------------------------------------------------------------------------------
+// Callback for handling the startElement event. Much of the jabber logic occurs
+// in this and the characterHandler callbacks.
+// Here we check for the various top level jabber elements: body, iq, etc.
+// ---------------------------------------------------------------------------------
+static void startElementHandler(
+ void *session, const xmlChar *name, const xmlChar **atts);
+
+// ---------------------------------------------------------------------------------
+// Callback for handling the endElement event. Updates the Jabber state machine
+// to let us know the element is over.
+// ---------------------------------------------------------------------------------
+static void endElementHandler( void *session, const xmlChar *name);
+
+// ---------------------------------------------------------------------------------
+// This is where we extract XML text content. In particular, this is useful for
+// extracting Jabber message bodies.
+// ---------------------------------------------------------------------------------
+static void characterHandler(
+ void *session, const xmlChar *ch, int len);
+
+static void parseWarningHandler( void *session, const char* msg, ... );
+static void parseErrorHandler( void *session, const char* msg, ... );
+
+// ---------------------------------------------------------------------------------
+// Tells the SAX parser which functions will be used as event callbacks
+// ---------------------------------------------------------------------------------
+static xmlSAXHandler SAXHandlerStruct = {
+ NULL, /* internalSubset */
+ NULL, /* isStandalone */
+ NULL, /* hasInternalSubset */
+ NULL, /* hasExternalSubset */
+ NULL, /* resolveEntity */
+ NULL, /* getEntity */
+ NULL, /* entityDecl */
+ NULL, /* notationDecl */
+ NULL, /* attributeDecl */
+ NULL, /* elementDecl */
+ NULL, /* unparsedEntityDecl */
+ NULL, /* setDocumentLocator */
+ NULL, /* startDocument */
+ NULL, /* endDocument */
+ startElementHandler, /* startElement */
+ endElementHandler, /* endElement */
+ NULL, /* reference */
+ characterHandler, /* characters */
+ NULL, /* ignorableWhitespace */
+ NULL, /* processingInstruction */
+ NULL, /* comment */
+ parseWarningHandler, /* xmlParserWarning */
+ parseErrorHandler, /* xmlParserError */
+ NULL, /* xmlParserFatalError : unused */
+ NULL, /* getParameterEntity */
+ NULL, /* cdataBlock; */
+ NULL, /* externalSubset; */
+ 1,
+ NULL,
+ NULL, /* startElementNs */
+ NULL, /* endElementNs */
+ NULL /* xmlStructuredErrorFunc */
+};
+
+// ---------------------------------------------------------------------------------
+// Our SAX handler pointer.
+// ---------------------------------------------------------------------------------
+static const xmlSAXHandlerPtr SAXHandler = &SAXHandlerStruct;
+
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 256
#endif
}
-void startElementHandler(
+static void startElementHandler(
void *session, const xmlChar *name, const xmlChar **atts) {
transport_session* ses = (transport_session*) session;
// ------------------------------------------------------------------
// See which tags are ending
// ------------------------------------------------------------------
-void endElementHandler( void *session, const xmlChar *name) {
+static void endElementHandler( void *session, const xmlChar *name) {
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
// takes data out of the body of the message and pushes it into
// the appropriate buffer
// ------------------------------------------------------------------
-void characterHandler(
+static void characterHandler(
void *session, const xmlChar *ch, int len) {
const char* p = (const char*) ch;
}
/* XXX change to warning handlers */
-void parseWarningHandler( void *session, const char* msg, ... ) {
+static void parseWarningHandler( void *session, const char* msg, ... ) {
va_list args;
va_start(args, msg);
fprintf(stderr, "XML WARNING: %s\n", msg );
}
-void parseErrorHandler( void *session, const char* msg, ... ){
+static void parseErrorHandler( void *session, const char* msg, ... ){
va_list args;
va_start(args, msg);