1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-04 12:58:17 +03:00

enhanced to include enough comments to make the api doc generation happy.

* genChRanges.py, chvalid.c, include/libxml/chvalid.h,
  doc/apibuild.py: enhanced to include enough comments to
  make the api doc generation happy.
This commit is contained in:
William M. Brack 2003-10-18 12:42:41 +00:00
parent 847332a0da
commit 196b38860c
5 changed files with 258 additions and 9 deletions

View File

@ -1,3 +1,9 @@
Sat Oct 18 20:34:18 HKT 2003 William Brack <wbrack@mmm.com.hk>
* genChRanges.py, chvalid.c, include/libxml/chvalid.h,
doc/apibuild.py: enhanced to include enough comments to
make the api doc generation happy.
Sat Oct 18 07:28:25 EDT 2003 Daniel Veillard <daniel@veillard.com> Sat Oct 18 07:28:25 EDT 2003 Daniel Veillard <daniel@veillard.com>
* nanohttp.c xmlIO.c include/libxml/nanohttp.h: starting work * nanohttp.c xmlIO.c include/libxml/nanohttp.h: starting work

View File

@ -5,7 +5,7 @@
* This file is automatically generated from the cvs source * This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script * definition files using the genChRanges.py Python script
* *
* Generation date: Sat Oct 18 09:01:24 2003 * Generation date: Sat Oct 18 20:32:35 2003
* Sources: chvalid.def * Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk> * William Brack <wbrack@mmm.com.hk>
*/ */
@ -149,6 +149,16 @@ xmlChRangeGroup xmlIsIdeographicGroup =
{3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0}; {3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
/**
* xmlCharInRange:
* @val: character to be validated
* @rptr: pointer to range to be used to validate
*
* Does a binary search of the range table to determine if char
* is valid
*
* Returns: true if character valid, false otherwise
*/
int int
xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) { xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) {
int low, high, mid; int low, high, mid;
@ -195,41 +205,121 @@ xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) {
return 0; return 0;
} }
/**
* xmlIsBaseChar:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsBaseChar_ch
* or xmlIsBaseCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsBaseChar(unsigned int ch) { xmlIsBaseChar(unsigned int ch) {
return(xmlIsBaseCharQ(ch)); return(xmlIsBaseCharQ(ch));
} }
/**
* xmlIsBlank:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsBlank_ch
* or xmlIsBlankQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsBlank(unsigned int ch) { xmlIsBlank(unsigned int ch) {
return(xmlIsBlankQ(ch)); return(xmlIsBlankQ(ch));
} }
/**
* xmlIsChar:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsChar_ch
* or xmlIsCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsChar(unsigned int ch) { xmlIsChar(unsigned int ch) {
return(xmlIsCharQ(ch)); return(xmlIsCharQ(ch));
} }
/**
* xmlIsCombining:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsCombining_ch
* or xmlIsCombiningQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsCombining(unsigned int ch) { xmlIsCombining(unsigned int ch) {
return(xmlIsCombiningQ(ch)); return(xmlIsCombiningQ(ch));
} }
/**
* xmlIsDigit:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsDigit_ch
* or xmlIsDigitQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsDigit(unsigned int ch) { xmlIsDigit(unsigned int ch) {
return(xmlIsDigitQ(ch)); return(xmlIsDigitQ(ch));
} }
/**
* xmlIsExtender:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsExtender_ch
* or xmlIsExtenderQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsExtender(unsigned int ch) { xmlIsExtender(unsigned int ch) {
return(xmlIsExtenderQ(ch)); return(xmlIsExtenderQ(ch));
} }
/**
* xmlIsIdeographic:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsIdeographic_ch
* or xmlIsIdeographicQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsIdeographic(unsigned int ch) { xmlIsIdeographic(unsigned int ch) {
return(xmlIsIdeographicQ(ch)); return(xmlIsIdeographicQ(ch));
} }
/**
* xmlIsPubidChar:
* @ch: character to validate
*
* This function is DEPRECATED. Use xmlIsPubidChar_ch
* or xmlIsPubidCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int int
xmlIsPubidChar(unsigned int ch) { xmlIsPubidChar(unsigned int ch) {
return(xmlIsPubidCharQ(ch)); return(xmlIsPubidCharQ(ch));

View File

@ -25,7 +25,6 @@ ignored_files = {
"testOOM.c": "out of memory tester", "testOOM.c": "out of memory tester",
"testOOMlib.h": "out of memory tester", "testOOMlib.h": "out of memory tester",
"testOOMlib.c": "out of memory tester", "testOOMlib.c": "out of memory tester",
"chvalid.h": "internal only + parsing problems",
"pattern.c": "not integrated yet", "pattern.c": "not integrated yet",
"pattern.h": "not integrated yet", "pattern.h": "not integrated yet",
} }

View File

@ -241,8 +241,8 @@ struct _xmlChSRange {
typedef struct _xmlChLRange xmlChLRange; typedef struct _xmlChLRange xmlChLRange;
typedef xmlChLRange *xmlChLRangePtr; typedef xmlChLRange *xmlChLRangePtr;
struct _xmlChLRange { struct _xmlChLRange {
unsigned low; unsigned int low;
unsigned high; unsigned int high;
}; };
typedef struct _xmlChRangeGroup xmlChRangeGroup; typedef struct _xmlChRangeGroup xmlChRangeGroup;
@ -254,7 +254,9 @@ struct _xmlChRangeGroup {
xmlChLRangePtr longRange; xmlChLRangePtr longRange;
}; };
/* Range checking routine */ /**
* Range checking routine
*/
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group); xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
@ -307,6 +309,14 @@ for f in fkeys:
numRanges = len(rangeTable) numRanges = len(rangeTable)
if numRanges >= minTableSize: # table is worthwhile if numRanges >= minTableSize: # table is worthwhile
header.write("XMLPUBVAR unsigned char %s_tab[256];\n" % f) header.write("XMLPUBVAR unsigned char %s_tab[256];\n" % f)
header.write("""
/**
* %s_ch:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
""" % f)
header.write("#define %s_ch(c)\t(%s_tab[(c)])\n" % (f, f)) header.write("#define %s_ch(c)\t(%s_tab[(c)])\n" % (f, f))
# write the constant data to the code file # write the constant data to the code file
@ -328,6 +338,16 @@ for f in fkeys:
except: except:
pass pass
firstFlag = 1 firstFlag = 1
header.write("""
/**
* %s_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
""" % f)
# okay, I'm tired of the messy lineup - let's automate it! # okay, I'm tired of the messy lineup - let's automate it!
pline = "#define %s_ch(c)" % f pline = "#define %s_ch(c)" % f
# 'ntab' is number of tabs needed to position to col. 33 from name end # 'ntab' is number of tabs needed to position to col. 33 from name end
@ -351,6 +371,14 @@ for f in fkeys:
pline += ")\n" pline += ")\n"
header.write(pline) header.write(pline)
header.write("""
/**
* %sQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
""" % f)
pline = "#define %sQ(c)" % f pline = "#define %sQ(c)" % f
ntab = 4 - (len(pline)) / 8 ntab = 4 - (len(pline)) / 8
if ntab < 0: if ntab < 0:
@ -441,6 +469,16 @@ for f in fkeys:
output.write( output.write(
""" """
/**
* xmlCharInRange:
* @val: character to be validated
* @rptr: pointer to range to be used to validate
*
* Does a binary search of the range table to determine if char
* is valid
*
* Returns: true if character valid, false otherwise
*/
int int
xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) { xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) {
int low, high, mid; int low, high, mid;
@ -493,6 +531,17 @@ xmlCharInRange (unsigned int val, xmlChRangeGroupPtr rptr) {
# finally, generate the ABI compatibility functions # finally, generate the ABI compatibility functions
# #
for f in fkeys: for f in fkeys:
output.write("""
/**
* %s:
* @ch: character to validate
*
* This function is DEPRECATED. Use %s_ch
* or %sQ instead
*
* Returns true if argument valid, false otherwise
*/
""" % (f, f, f))
output.write("int\n%s(unsigned int ch) {\n return(%sQ(ch));\n}\n\n" % (f,f)) output.write("int\n%s(unsigned int ch) {\n return(%sQ(ch));\n}\n\n" % (f,f))
header.write("XMLPUBFUN int XMLCALL\n\t\t%s(unsigned int ch);\n" % f); header.write("XMLPUBFUN int XMLCALL\n\t\t%s(unsigned int ch);\n" % f);
# #

View File

@ -5,7 +5,7 @@
* This file is automatically generated from the cvs source * This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script * definition files using the genChRanges.py Python script
* *
* Generation date: Sat Oct 18 09:01:24 2003 * Generation date: Sat Oct 18 20:32:35 2003
* Sources: chvalid.def * Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk> * William Brack <wbrack@mmm.com.hk>
*/ */
@ -33,8 +33,8 @@ struct _xmlChSRange {
typedef struct _xmlChLRange xmlChLRange; typedef struct _xmlChLRange xmlChLRange;
typedef xmlChLRange *xmlChLRangePtr; typedef xmlChLRange *xmlChLRangePtr;
struct _xmlChLRange { struct _xmlChLRange {
unsigned low; unsigned int low;
unsigned high; unsigned int high;
}; };
typedef struct _xmlChRangeGroup xmlChRangeGroup; typedef struct _xmlChRangeGroup xmlChRangeGroup;
@ -46,29 +46,76 @@ struct _xmlChRangeGroup {
xmlChLRangePtr longRange; xmlChLRangePtr longRange;
}; };
/* Range checking routine */ /**
* Range checking routine
*/
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group); xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
/**
* xmlIsBaseChar_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
((0x61 <= (c)) && ((c) <= 0x7a)) || \ ((0x61 <= (c)) && ((c) <= 0x7a)) || \
((0xc0 <= (c)) && ((c) <= 0xd6)) || \ ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
((0xd8 <= (c)) && ((c) <= 0xf6)) || \ ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
((0xf8 <= (c)) && ((c) <= 0xff))) ((0xf8 <= (c)) && ((c) <= 0xff)))
/**
* xmlIsBaseCharQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \ #define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
xmlIsBaseChar_ch((c)) : \ xmlIsBaseChar_ch((c)) : \
xmlCharInRange((c), &xmlIsBaseCharGroup)) xmlCharInRange((c), &xmlIsBaseCharGroup))
XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup; XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup;
/**
* xmlIsBlank_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsBlank_ch(c) (((c) == 0x20) || \ #define xmlIsBlank_ch(c) (((c) == 0x20) || \
((0x9 <= (c)) && ((c) <= 0xa)) || \ ((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd)) ((c) == 0xd))
/**
* xmlIsBlankQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsBlankQ(c) (((c) < 0x100) ? \ #define xmlIsBlankQ(c) (((c) < 0x100) ? \
xmlIsBlank_ch((c)) : 0) xmlIsBlank_ch((c)) : 0)
/**
* xmlIsChar_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \ #define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd) || \ ((c) == 0xd) || \
((0x20 <= (c)) && ((c) <= 0xff))) ((0x20 <= (c)) && ((c) <= 0xff)))
/**
* xmlIsCharQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsCharQ(c) (((c) < 0x100) ? \ #define xmlIsCharQ(c) (((c) < 0x100) ? \
xmlIsChar_ch((c)) :\ xmlIsChar_ch((c)) :\
(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \ (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
@ -76,23 +123,67 @@ XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup;
((0x10000 <= (c)) && ((c) <= 0x10ffff)))) ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
XMLPUBVAR xmlChRangeGroup xmlIsCharGroup; XMLPUBVAR xmlChRangeGroup xmlIsCharGroup;
/**
* xmlIsCombiningQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsCombiningQ(c) (((c) < 0x100) ? \ #define xmlIsCombiningQ(c) (((c) < 0x100) ? \
0 : \ 0 : \
xmlCharInRange((c), &xmlIsCombiningGroup)) xmlCharInRange((c), &xmlIsCombiningGroup))
XMLPUBVAR xmlChRangeGroup xmlIsCombiningGroup; XMLPUBVAR xmlChRangeGroup xmlIsCombiningGroup;
/**
* xmlIsDigit_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39))) #define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
/**
* xmlIsDigitQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsDigitQ(c) (((c) < 0x100) ? \ #define xmlIsDigitQ(c) (((c) < 0x100) ? \
xmlIsDigit_ch((c)) : \ xmlIsDigit_ch((c)) : \
xmlCharInRange((c), &xmlIsDigitGroup)) xmlCharInRange((c), &xmlIsDigitGroup))
XMLPUBVAR xmlChRangeGroup xmlIsDigitGroup; XMLPUBVAR xmlChRangeGroup xmlIsDigitGroup;
/**
* xmlIsExtender_ch:
*
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsExtender_ch(c) (((c) == 0xb7)) #define xmlIsExtender_ch(c) (((c) == 0xb7))
/**
* xmlIsExtenderQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsExtenderQ(c) (((c) < 0x100) ? \ #define xmlIsExtenderQ(c) (((c) < 0x100) ? \
xmlIsExtender_ch((c)) : \ xmlIsExtender_ch((c)) : \
xmlCharInRange((c), &xmlIsExtenderGroup)) xmlCharInRange((c), &xmlIsExtenderGroup))
XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup; XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup;
/**
* xmlIsIdeographicQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \ #define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
0 :\ 0 :\
(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \ (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
@ -101,7 +192,21 @@ XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup;
XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup; XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup;
XMLPUBVAR unsigned char xmlIsPubidChar_tab[256]; XMLPUBVAR unsigned char xmlIsPubidChar_tab[256];
/**
* xmlIsPubidChar_ch:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)]) #define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
/**
* xmlIsPubidCharQ:
* @c: char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \ #define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
xmlIsPubidChar_ch((c)) : 0) xmlIsPubidChar_ch((c)) : 0)