[Expat-checkins] expat/lib xmltok.c,1.10,1.11

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Fri May 17 11:18:02 2002


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv31108/lib

Modified Files:
	xmltok.c 
Log Message:
Minor nit; layout function signatures in a more consistent way.

Index: xmltok.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** xmltok.c	17 May 2002 18:05:06 -0000	1.10
--- xmltok.c	17 May 2002 18:17:33 -0000	1.11
***************
*** 74,91 ****
  #define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0)
  
! static
! int isNever(const ENCODING *enc, const char *p)
  {
    return 0;
  }
  
! static
! int utf8_isName2(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
  }
  
! static
! int utf8_isName3(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
--- 74,91 ----
  #define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0)
  
! static int
! isNever(const ENCODING *enc, const char *p)
  {
    return 0;
  }
  
! static int
! utf8_isName2(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
  }
  
! static int
! utf8_isName3(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
***************
*** 94,105 ****
  #define utf8_isName4 isNever
  
! static
! int utf8_isNmstrt2(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
  }
  
! static
! int utf8_isNmstrt3(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
--- 94,105 ----
  #define utf8_isName4 isNever
  
! static int
! utf8_isNmstrt2(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
  }
  
! static int
! utf8_isNmstrt3(const ENCODING *enc, const char *p)
  {
    return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
***************
*** 110,121 ****
  #define utf8_isInvalid2 isNever
  
! static
! int utf8_isInvalid3(const ENCODING *enc, const char *p)
  {
    return UTF8_INVALID3((const unsigned char *)p);
  }
  
! static
! int utf8_isInvalid4(const ENCODING *enc, const char *p)
  {
    return UTF8_INVALID4((const unsigned char *)p);
--- 110,121 ----
  #define utf8_isInvalid2 isNever
  
! static int
! utf8_isInvalid3(const ENCODING *enc, const char *p)
  {
    return UTF8_INVALID3((const unsigned char *)p);
  }
  
! static int
! utf8_isInvalid4(const ENCODING *enc, const char *p)
  {
    return UTF8_INVALID4((const unsigned char *)p);
***************
*** 190,195 ****
  
  #ifdef XML_MIN_SIZE
! static
! int sb_byteType(const ENCODING *enc, const char *p)
  {
    return SB_BYTE_TYPE(enc, p);
--- 190,195 ----
  
  #ifdef XML_MIN_SIZE
! static int
! sb_byteType(const ENCODING *enc, const char *p)
  {
    return SB_BYTE_TYPE(enc, p);
***************
*** 204,209 ****
  #define BYTE_TO_ASCII(enc, p) \
   (((const struct normal_encoding *)(enc))->byteToAscii(enc, p))
! static
! int sb_byteToAscii(const ENCODING *enc, const char *p)
  {
    return *p;
--- 204,209 ----
  #define BYTE_TO_ASCII(enc, p) \
   (((const struct normal_encoding *)(enc))->byteToAscii(enc, p))
! static int
! sb_byteToAscii(const ENCODING *enc, const char *p)
  {
    return *p;
***************
*** 233,238 ****
  #define CHAR_MATCHES(enc, p, c) \
   (((const struct normal_encoding *)(enc))->charMatches(enc, p, c))
! static
! int sb_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return *p == c;
--- 233,238 ----
  #define CHAR_MATCHES(enc, p, c) \
   (((const struct normal_encoding *)(enc))->charMatches(enc, p, c))
! static int
! sb_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return *p == c;
***************
*** 263,270 ****
  };
  
! static
! void utf8_toUtf8(const ENCODING *enc,
! 		 const char **fromP, const char *fromLim,
! 		 char **toP, const char *toLim)
  {
    char *to;
--- 263,270 ----
  };
  
! static void
! utf8_toUtf8(const ENCODING *enc,
! 	    const char **fromP, const char *fromLim,
! 	    char **toP, const char *toLim)
  {
    char *to;
***************
*** 282,289 ****
  }
  
! static
! void utf8_toUtf16(const ENCODING *enc,
! 		  const char **fromP, const char *fromLim,
! 		  unsigned short **toP, const unsigned short *toLim)
  {
    unsigned short *to = *toP;
--- 282,289 ----
  }
  
! static void
! utf8_toUtf16(const ENCODING *enc,
! 	     const char **fromP, const char *fromLim,
! 	     unsigned short **toP, const unsigned short *toLim)
  {
    unsigned short *to = *toP;
***************
*** 369,376 ****
  };
  
! static
! void latin1_toUtf8(const ENCODING *enc,
! 		   const char **fromP, const char *fromLim,
! 		   char **toP, const char *toLim)
  {
    for (;;) {
--- 369,376 ----
  };
  
! static void
! latin1_toUtf8(const ENCODING *enc,
! 	      const char **fromP, const char *fromLim,
! 	      char **toP, const char *toLim)
  {
    for (;;) {
***************
*** 394,401 ****
  }
  
! static
! void latin1_toUtf16(const ENCODING *enc,
! 		    const char **fromP, const char *fromLim,
! 		    unsigned short **toP, const unsigned short *toLim)
  {
    while (*fromP != fromLim && *toP != toLim)
--- 394,401 ----
  }
  
! static void
! latin1_toUtf16(const ENCODING *enc,
! 	       const char **fromP, const char *fromLim,
! 	       unsigned short **toP, const unsigned short *toLim)
  {
    while (*fromP != fromLim && *toP != toLim)
***************
*** 427,434 ****
  };
  
! static
! void ascii_toUtf8(const ENCODING *enc,
! 		  const char **fromP, const char *fromLim,
! 		  char **toP, const char *toLim)
  {
    while (*fromP != fromLim && *toP != toLim)
--- 427,434 ----
  };
  
! static void
! ascii_toUtf8(const ENCODING *enc,
! 	     const char **fromP, const char *fromLim,
! 	     char **toP, const char *toLim)
  {
    while (*fromP != fromLim && *toP != toLim)
***************
*** 460,464 ****
  };
  
! static int unicode_byte_type(char hi, char lo)
  {
    switch ((unsigned char)hi) {
--- 460,465 ----
  };
  
! static int
! unicode_byte_type(char hi, char lo)
  {
    switch ((unsigned char)hi) {
***************
*** 479,484 ****
  
  #define DEFINE_UTF16_TO_UTF8(E) \
! static \
! void E ## toUtf8(const ENCODING *enc, \
  		 const char **fromP, const char *fromLim, \
  		 char **toP, const char *toLim) \
--- 480,485 ----
  
  #define DEFINE_UTF16_TO_UTF8(E) \
! static void \
! E ## toUtf8(const ENCODING *enc, \
  		 const char **fromP, const char *fromLim, \
  		 char **toP, const char *toLim) \
***************
*** 542,547 ****
  
  #define DEFINE_UTF16_TO_UTF16(E) \
! static \
! void E ## toUtf16(const ENCODING *enc, \
  		  const char **fromP, const char *fromLim, \
  		  unsigned short **toP, const unsigned short *toLim) \
--- 543,548 ----
  
  #define DEFINE_UTF16_TO_UTF16(E) \
! static void \
! E ## toUtf16(const ENCODING *enc, \
  		  const char **fromP, const char *fromLim, \
  		  unsigned short **toP, const unsigned short *toLim) \
***************
*** 592,621 ****
  #ifdef XML_MIN_SIZE
  
! static
! int little2_byteType(const ENCODING *enc, const char *p)
  {
    return LITTLE2_BYTE_TYPE(enc, p);
  }
  
! static
! int little2_byteToAscii(const ENCODING *enc, const char *p)
  {
    return LITTLE2_BYTE_TO_ASCII(enc, p);
  }
  
! static
! int little2_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return LITTLE2_CHAR_MATCHES(enc, p, c);
  }
  
! static
! int little2_isNameMin(const ENCODING *enc, const char *p)
  {
    return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
  }
  
! static
! int little2_isNmstrtMin(const ENCODING *enc, const char *p)
  {
    return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
--- 593,622 ----
  #ifdef XML_MIN_SIZE
  
! static int
! little2_byteType(const ENCODING *enc, const char *p)
  {
    return LITTLE2_BYTE_TYPE(enc, p);
  }
  
! static int
! little2_byteToAscii(const ENCODING *enc, const char *p)
  {
    return LITTLE2_BYTE_TO_ASCII(enc, p);
  }
  
! static int
! little2_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return LITTLE2_CHAR_MATCHES(enc, p, c);
  }
  
! static int
! little2_isNameMin(const ENCODING *enc, const char *p)
  {
    return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
  }
  
! static int
! little2_isNmstrtMin(const ENCODING *enc, const char *p)
  {
    return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
***************
*** 731,760 ****
  #ifdef XML_MIN_SIZE
  
! static
! int big2_byteType(const ENCODING *enc, const char *p)
  {
    return BIG2_BYTE_TYPE(enc, p);
  }
  
! static
! int big2_byteToAscii(const ENCODING *enc, const char *p)
  {
    return BIG2_BYTE_TO_ASCII(enc, p);
  }
  
! static
! int big2_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return BIG2_CHAR_MATCHES(enc, p, c);
  }
  
! static
! int big2_isNameMin(const ENCODING *enc, const char *p)
  {
    return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
  }
  
! static
! int big2_isNmstrtMin(const ENCODING *enc, const char *p)
  {
    return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
--- 732,761 ----
  #ifdef XML_MIN_SIZE
  
! static int
! big2_byteType(const ENCODING *enc, const char *p)
  {
    return BIG2_BYTE_TYPE(enc, p);
  }
  
! static int
! big2_byteToAscii(const ENCODING *enc, const char *p)
  {
    return BIG2_BYTE_TO_ASCII(enc, p);
  }
  
! static int
! big2_charMatches(const ENCODING *enc, const char *p, int c)
  {
    return BIG2_CHAR_MATCHES(enc, p, c);
  }
  
! static int
! big2_isNameMin(const ENCODING *enc, const char *p)
  {
    return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
  }
  
! static int
! big2_isNmstrtMin(const ENCODING *enc, const char *p)
  {
    return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
***************
*** 858,863 ****
  #undef PREFIX
  
! static
! int streqci(const char *s1, const char *s2)
  {
    for (;;) {
--- 859,864 ----
  #undef PREFIX
  
! static int
! streqci(const char *s1, const char *s2)
  {
    for (;;) {
***************
*** 876,888 ****
  }
  
! static
! void initUpdatePosition(const ENCODING *enc, const char *ptr,
! 			const char *end, POSITION *pos)
  {
    normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
  }
  
! static
! int toAscii(const ENCODING *enc, const char *ptr, const char *end)
  {
    char buf[1];
--- 877,889 ----
  }
  
! static void
! initUpdatePosition(const ENCODING *enc, const char *ptr,
! 		   const char *end, POSITION *pos)
  {
    normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
  }
  
! static int
! toAscii(const ENCODING *enc, const char *ptr, const char *end)
  {
    char buf[1];
***************
*** 895,900 ****
  }
  
! static
! int isSpace(int c)
  {
    switch (c) {
--- 896,901 ----
  }
  
! static int
! isSpace(int c)
  {
    switch (c) {
***************
*** 910,921 ****
  /* Return 1 if there's just optional white space
  or there's an S followed by name=val. */
! static
! int parsePseudoAttribute(const ENCODING *enc,
! 			 const char *ptr,
! 			 const char *end,
! 			 const char **namePtr,
! 			 const char **nameEndPtr,
! 			 const char **valPtr,
! 			 const char **nextTokPtr)
  {
    int c;
--- 911,922 ----
  /* Return 1 if there's just optional white space
  or there's an S followed by name=val. */
! static int
! parsePseudoAttribute(const ENCODING *enc,
! 		     const char *ptr,
! 		     const char *end,
! 		     const char **namePtr,
! 		     const char **nameEndPtr,
! 		     const char **valPtr,
! 		     const char **nextTokPtr)
  {
    int c;
***************
*** 1016,1033 ****
  };
  
! static
! int doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *,
! 		                                     const char *,
! 						     const char *),
! 		   int isGeneralTextEntity,
! 		   const ENCODING *enc,
! 		   const char *ptr,
! 		   const char *end,
! 		   const char **badPtr,
! 		   const char **versionPtr,
! 		   const char **versionEndPtr,
! 		   const char **encodingName,
! 		   const ENCODING **encoding,
! 		   int *standalone)
  {
    const char *val = 0;
--- 1017,1034 ----
  };
  
! static int
! doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *,
! 						 const char *,
! 						 const char *),
! 	       int isGeneralTextEntity,
! 	       const ENCODING *enc,
! 	       const char *ptr,
! 	       const char *end,
! 	       const char **badPtr,
! 	       const char **versionPtr,
! 	       const char **versionEndPtr,
! 	       const char **encodingName,
! 	       const ENCODING **encoding,
! 	       int *standalone)
  {
    const char *val = 0;
***************
*** 1108,1113 ****
  }
  
! static
! int checkCharRefNumber(int result)
  {
    switch (result >> 8) {
--- 1109,1114 ----
  }
  
! static int
! checkCharRefNumber(int result)
  {
    switch (result >> 8) {
***************
*** 1127,1131 ****
  }
  
! int XmlUtf8Encode(int c, char *buf)
  {
    enum {
--- 1128,1133 ----
  }
  
! int
! XmlUtf8Encode(int c, char *buf)
  {
    enum {
***************
*** 1163,1167 ****
  }
  
! int XmlUtf16Encode(int charNum, unsigned short *buf)
  {
    if (charNum < 0)
--- 1165,1170 ----
  }
  
! int
! XmlUtf16Encode(int charNum, unsigned short *buf)
  {
    if (charNum < 0)
***************
*** 1188,1198 ****
  };
  
! int XmlSizeOfUnknownEncoding(void)
  {
    return sizeof(struct unknown_encoding);
  }
  
! static
! int unknown_isName(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
--- 1191,1202 ----
  };
  
! int
! XmlSizeOfUnknownEncoding(void)
  {
    return sizeof(struct unknown_encoding);
  }
  
! static int
! unknown_isName(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
***************
*** 1203,1208 ****
  }
  
! static
! int unknown_isNmstrt(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
--- 1207,1212 ----
  }
  
! static int
! unknown_isNmstrt(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
***************
*** 1213,1218 ****
  }
  
! static
! int unknown_isInvalid(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
--- 1217,1222 ----
  }
  
! static int
! unknown_isInvalid(const ENCODING *enc, const char *p)
  {
    int c = ((const struct unknown_encoding *)enc)
***************
*** 1221,1228 ****
  }
  
! static
! void unknown_toUtf8(const ENCODING *enc,
! 		    const char **fromP, const char *fromLim,
! 		    char **toP, const char *toLim)
  {
    char buf[XML_UTF8_ENCODE_MAX];
--- 1225,1232 ----
  }
  
! static void
! unknown_toUtf8(const ENCODING *enc,
! 	       const char **fromP, const char *fromLim,
! 	       char **toP, const char *toLim)
  {
    char buf[XML_UTF8_ENCODE_MAX];
***************
*** 1256,1263 ****
  }
  
! static
! void unknown_toUtf16(const ENCODING *enc,
! 		     const char **fromP, const char *fromLim,
! 		     unsigned short **toP, const unsigned short *toLim)
  {
    while (*fromP != fromLim && *toP != toLim) {
--- 1260,1267 ----
  }
  
! static void
! unknown_toUtf16(const ENCODING *enc,
! 		const char **fromP, const char *fromLim,
! 		unsigned short **toP, const unsigned short *toLim)
  {
    while (*fromP != fromLim && *toP != toLim) {
***************
*** 1392,1397 ****
  };
  
! static
! int getEncodingIndex(const char *name)
  {
    static const char *encodingNames[] = {
--- 1396,1401 ----
  };
  
! static int
! getEncodingIndex(const char *name)
  {
    static const char *encodingNames[] = {
***************
*** 1427,1437 ****
  
  
! static
! int initScan(const ENCODING **encodingTable,
! 	     const INIT_ENCODING *enc,
! 	     int state,
! 	     const char *ptr,
! 	     const char *end,
! 	     const char **nextTokPtr)
  {
    const ENCODING **encPtr;
--- 1431,1441 ----
  
  
! static int
! initScan(const ENCODING **encodingTable,
! 	 const INIT_ENCODING *enc,
! 	 int state,
! 	 const char *ptr,
! 	 const char *end,
! 	 const char **nextTokPtr)
  {
    const ENCODING **encPtr;