Commit 8ea29c48 authored by Daniel Veillard's avatar Daniel Veillard

fixed bug #335603 and resync'ed genChRanges.py to the expected output.

* chvalid.c genChRanges.py include/libxml/chvalid.h: fixed bug
  #335603 and resync'ed genChRanges.py to the expected output.
Daniel
parent 2a8c4c47
Mon Mar 27 00:51:40 CEST 2006 Daniel Veillard <daniel@veillard.com>
* chvalid.c genChRanges.py include/libxml/chvalid.h: fixed bug
#335603 and resync'ed genChRanges.py to the expected output.
Wed Mar 22 00:14:34 CET 2006 Daniel Veillard <daniel@veillard.com>
* xmlregexp.c: applied patch from Youri Golovanov fixing bug
......
......@@ -5,7 +5,7 @@
* This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script
*
* Generation date: Tue Nov 18 08:14:21 2003
* Generation date: Mon Mar 27 00:45:29 2006
* Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk>
*/
......@@ -22,7 +22,7 @@
* allowed.
*
*/
unsigned char xmlIsPubidChar_tab[256] = {
const unsigned char xmlIsPubidChar_tab[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
......
......@@ -223,6 +223,7 @@ header.write(
#define __XML_CHVALID_H__
#include <libxml/xmlversion.h>
#include <libxml/xmlstring.h>
#ifdef __cplusplus
extern "C" {
......@@ -311,7 +312,7 @@ for f in fkeys:
rangeTable = makeRange(Functs[f][0])
numRanges = len(rangeTable)
if numRanges >= minTableSize: # table is worthwhile
header.write("XMLPUBVAR unsigned char %s_tab[256];\n" % f)
header.write("XMLPUBVAR const unsigned char %s_tab[256];\n" % f)
header.write("""
/**
* %s_ch:
......@@ -323,7 +324,7 @@ for f in fkeys:
header.write("#define %s_ch(c)\t(%s_tab[(c)])\n" % (f, f))
# write the constant data to the code file
output.write("unsigned char %s_tab[256] = {\n" % f)
output.write("const unsigned char %s_tab[256] = {\n" % f)
pline = " "
for n in range(255):
pline += " 0x%02x," % Functs[f][0][n]
......@@ -490,6 +491,8 @@ xmlCharInRange (unsigned int val, const xmlChRangeGroupPtr rptr) {
int low, high, mid;
xmlChSRangePtr sptr;
xmlChLRangePtr lptr;
if (rptr == NULL) return(0);
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
if (rptr->nbShortRange == 0)
return 0;
......@@ -564,8 +567,12 @@ header.write("""
}
#endif
#endif /* __XML_CHVALID_H__ */
""");
""")
header.close()
output.write("""#define bottom_chvalid
#include "elfgcchack.h"
""")
output.close()
/*
* Summary: Unicode character range checking
* Description: this module exports interfaces for the character
* range validation APIs
* range validation APIs
*
* This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script
*
* Generation date: Tue Nov 18 08:14:21 2003
* Generation date: Mon Mar 27 00:45:29 2006
* Sources: chvalid.def
* Author: William Brack <wbrack@mmm.com.hk>
*/
......@@ -188,7 +188,7 @@ XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup;
((0x3021 <= (c)) && ((c) <= 0x3029))))
XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup;
XMLPUBVAR unsigned char xmlIsPubidChar_tab[256];
XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
/**
* xmlIsPubidChar_ch:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment