[Opensrf-commits] r1613 - in trunk: include/opensrf src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 9 13:51:04 EST 2009


Author: scottmk
Date: 2009-01-09 13:51:01 -0500 (Fri, 09 Jan 2009)
New Revision: 1613

Modified:
   trunk/include/opensrf/transport_session.h
   trunk/src/libopensrf/transport_session.c
Log:
Move the xmlSAXHandler out of the header and into the 
implementation file, along with the declarations of the
associated callback functions (which are now static)


Modified: trunk/include/opensrf/transport_session.h
===================================================================
--- trunk/include/opensrf/transport_session.h	2009-01-08 22:37:32 UTC (rev 1612)
+++ trunk/include/opensrf/transport_session.h	2009-01-09 18:51:01 UTC (rev 1613)
@@ -38,73 +38,6 @@
 #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.
 // ---------------------------------------------------------------------------------

Modified: trunk/src/libopensrf/transport_session.c
===================================================================
--- trunk/src/libopensrf/transport_session.c	2009-01-08 22:37:32 UTC (rev 1612)
+++ trunk/src/libopensrf/transport_session.c	2009-01-09 18:51:01 UTC (rev 1613)
@@ -1,5 +1,72 @@
 #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
@@ -319,7 +386,7 @@
 }
 
 
-void startElementHandler(
+static void startElementHandler(
 	void *session, const xmlChar *name, const xmlChar **atts) {
 
 	transport_session* ses = (transport_session*) session;
@@ -447,7 +514,7 @@
 // ------------------------------------------------------------------
 // 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; }
 
@@ -562,7 +629,7 @@
 // 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;
@@ -599,7 +666,7 @@
 }
 
 /* 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);
@@ -609,7 +676,7 @@
 	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);



More information about the opensrf-commits mailing list