[Opensrf-commits] r1614 - trunk/src/jserver

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 9 15:14:38 EST 2009


Author: scottmk
Date: 2009-01-09 15:14:35 -0500 (Fri, 09 Jan 2009)
New Revision: 1614

Modified:
   trunk/src/jserver/osrf_chat.c
   trunk/src/jserver/osrf_chat.h
Log:
Move the xmlSAXHandler out of the header and into the
implementation file, along with the prototypes of the
associated callback functions (which are now static)


Modified: trunk/src/jserver/osrf_chat.c
===================================================================
--- trunk/src/jserver/osrf_chat.c	2009-01-09 18:51:01 UTC (rev 1613)
+++ trunk/src/jserver/osrf_chat.c	2009-01-09 20:14:35 UTC (rev 1614)
@@ -18,6 +18,49 @@
 #include <stdio.h>
 #include <time.h>
 
+static void osrfChatStartStream( void* blob );
+static void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts );
+static void osrfChatEndElement( void* blob, const xmlChar* name );
+static void osrfChatHandleCharacter(void* blob, const xmlChar *ch, int len);
+static void osrfChatParseError( void* blob, const char* msg, ... );
+
+static xmlSAXHandler osrfChatSaxHandlerStruct = {
+   NULL,						/* internalSubset */
+   NULL,						/* isStandalone */
+   NULL,						/* hasInternalSubset */
+   NULL,						/* hasExternalSubset */
+   NULL,						/* resolveEntity */
+   NULL,						/* getEntity */
+   NULL,						/* entityDecl */
+   NULL,						/* notationDecl */
+   NULL,						/* attributeDecl */
+   NULL,						/* elementDecl */
+   NULL,						/* unparsedEntityDecl */
+   NULL,						/* setDocumentLocator */
+   osrfChatStartStream, 		/* startDocument */
+   NULL,						/* endDocument */
+   osrfChatStartElement,		/* startElement */
+   osrfChatEndElement,			/* endElement */
+   NULL,						/* reference */
+   osrfChatHandleCharacter,		/* characters */
+   NULL,						/* ignorableWhitespace */
+   NULL,						/* processingInstruction */
+   NULL,						/* comment */
+   osrfChatParseError,			/* xmlParserWarning */
+   osrfChatParseError,			/* xmlParserError */
+   NULL,						/* xmlParserFatalError : unused */
+   NULL,						/* getParameterEntity */
+   NULL,						/* cdataBlock; */
+   NULL,						/* externalSubset; */
+   1,
+   NULL,
+   NULL,						/* startElementNs */
+   NULL,						/* endElementNs */
+   NULL							/* xmlStructuredErrorFunc */
+};
+
+static const xmlSAXHandlerPtr osrfChatSaxHandler = &osrfChatSaxHandlerStruct;
+
 #ifndef HOST_NAME_MAX
 #define HOST_NAME_MAX 256
 #endif
@@ -437,12 +480,12 @@
 }
 
 
-void osrfChatStartStream( void* blob ) {
+static void osrfChatStartStream( void* blob ) {
 	osrfLogDebug( OSRF_LOG_MARK, "Starting new client stream...");
 }
 
 
-void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts ) {
+static void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts ) {
 	if(!(blob && name)) return;
 	osrfChatNode* node = (osrfChatNode*) blob;
 
@@ -707,7 +750,7 @@
 
 
 
-void osrfChatEndElement( void* blob, const xmlChar* name ) {
+static void osrfChatEndElement( void* blob, const xmlChar* name ) {
 	if(!(blob && name)) return;
 	osrfChatNode* node = (osrfChatNode*) blob;
 
@@ -759,14 +802,14 @@
 }
 
 
-void osrfChatHandleCharacter( void* blob, const xmlChar *ch, int len) {
+static void osrfChatHandleCharacter( void* blob, const xmlChar *ch, int len) {
 	if(!(blob && ch && len)) return;
 	osrfChatNode* node = (osrfChatNode*) blob;
 
 	/*
 	osrfLogDebug( OSRF_LOG_MARK, "Char Handler: state %d, xmlstate %d, chardata %s", 
 			node->state, node->xmlstate, (char*) ch );
-			*/
+	*/
 
 	if( node->state == OSRF_CHAT_STATE_CONNECTING ) {
 		if( node->xmlstate & OSRF_CHAT_STATE_INIQ ) {
@@ -822,7 +865,7 @@
 }
 
 
-void osrfChatParseError( void* blob, const char* msg, ... ) {
+static void osrfChatParseError( void* blob, const char* msg, ... ) {
 
 	osrfChatXMLErrorOcurred = 1;
 }

Modified: trunk/src/jserver/osrf_chat.h
===================================================================
--- trunk/src/jserver/osrf_chat.h	2009-01-09 18:51:01 UTC (rev 1613)
+++ trunk/src/jserver/osrf_chat.h	2009-01-09 20:14:35 UTC (rev 1614)
@@ -202,13 +202,6 @@
 /* initializes the negotiation of a server to server connection */
 int osrfChatInitS2S( osrfChatServer* cs, char* remote, char* toAddr, char* msgXML );
 
-
-void osrfChatStartStream( void* blob );
-void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts );
-void osrfChatEndElement( void* blob, const xmlChar* name );
-void osrfChatHandleCharacter(void* blob, const xmlChar *ch, int len);
-void osrfChatParseError( void* blob, const char* msg, ... );
-
 int osrfChatHandleNewConnection( osrfChatNode* node, const char* name, const xmlChar** atts );
 int osrfChatHandleConnecting( osrfChatNode* node, const char* name, const xmlChar** atts );
 int osrfChatHandleConnected( osrfChatNode* node, const char* name, const xmlChar** atts );
@@ -220,48 +213,9 @@
 
 void osrfChatS2SMessageFree(void* n);
 
-
-
 /* generates a random sha1 hex key */
 char* osrfChatMkAuthKey();
 
-static xmlSAXHandler osrfChatSaxHandlerStruct = {
-   NULL,								/* internalSubset */
-   NULL,								/* isStandalone */
-   NULL,								/* hasInternalSubset */
-   NULL,								/* hasExternalSubset */
-   NULL,								/* resolveEntity */
-   NULL,								/* getEntity */
-   NULL,								/* entityDecl */
-   NULL,								/* notationDecl */
-   NULL,								/* attributeDecl */
-   NULL,								/* elementDecl */
-   NULL,								/* unparsedEntityDecl */
-   NULL,								/* setDocumentLocator */
-   osrfChatStartStream,			/* startDocument */
-   NULL,								/* endDocument */
-	osrfChatStartElement,		/* startElement */
-	osrfChatEndElement,			/* endElement */
-   NULL,								/* reference */
-	osrfChatHandleCharacter,	/* characters */
-   NULL,								/* ignorableWhitespace */
-   NULL,								/* processingInstruction */
-   NULL,								/* comment */
-   osrfChatParseError,			/* xmlParserWarning */
-   osrfChatParseError,			/* xmlParserError */
-   NULL,								/* xmlParserFatalError : unused */
-   NULL,								/* getParameterEntity */
-   NULL,								/* cdataBlock; */
-   NULL,								/* externalSubset; */
-   1,
-   NULL,
-   NULL,								/* startElementNs */
-   NULL,								/* endElementNs */
-	NULL								/* xmlStructuredErrorFunc */
-};
-
-static const xmlSAXHandlerPtr osrfChatSaxHandler = &osrfChatSaxHandlerStruct;
-
 #ifdef __cplusplus
 }
 #endif



More information about the opensrf-commits mailing list