[Expat-checkins] expat/lib expat.h, 1.76, 1.77 expat_external.h, 1.3, 1.4 xmlparse.c, 1.150, 1.151 xmltok.h, 1.10, 1.11
Karl Waclawek
kwaclaw at users.sourceforge.net
Fri Dec 23 15:45:33 CET 2005
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22010/lib
Modified Files:
expat.h expat_external.h xmlparse.c xmltok.h
Log Message:
Added support for 64-bit integers when reporting byte indexes,
line and column numbers. Can be turned on/off using the
XML_LARGE_SIZE switch.
Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- expat.h 29 Jan 2005 04:48:43 -0000 1.76
+++ expat.h 23 Dec 2005 14:45:27 -0000 1.77
@@ -905,9 +905,9 @@
was detected; otherwise the location is the location of the last
parse event, as described above.
*/
-XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
-XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
-XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
+XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
+XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
+XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
/* Return the number of bytes in the current event.
Returns 0 if the event is in an internal entity.
Index: expat_external.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat_external.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- expat_external.h 26 Nov 2004 00:20:21 -0000 1.3
+++ expat_external.h 23 Dec 2005 14:45:27 -0000 1.4
@@ -94,6 +94,14 @@
typedef char XML_LChar;
#endif /* XML_UNICODE */
+#ifdef XML_LARGE_SIZE /* Use large integers for counts and positions. */
+typedef long long XML_Index;
+typedef unsigned long long XML_Size;
+#else
+typedef long XML_Index;
+typedef unsigned long XML_Size;
+#endif /* XML_LARGE_SIZE */
+
#ifdef __cplusplus
}
#endif
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- xmlparse.c 28 Nov 2005 20:02:36 -0000 1.150
+++ xmlparse.c 23 Dec 2005 14:45:27 -0000 1.151
@@ -458,7 +458,7 @@
char *m_bufferEnd;
/* allocated end of buffer */
const char *m_bufferLim;
- long m_parseEndByteIndex;
+ XML_Index m_parseEndByteIndex;
const char *m_parseEndPtr;
XML_Char *m_dataBuf;
XML_Char *m_dataBufEnd;
@@ -1751,7 +1751,7 @@
return errorCode;
}
-long XMLCALL
+XML_Index XMLCALL
XML_GetCurrentByteIndex(XML_Parser parser)
{
if (eventPtr)
@@ -1780,7 +1780,7 @@
return (char *) 0;
}
-int XMLCALL
+XML_Size XMLCALL
XML_GetCurrentLineNumber(XML_Parser parser)
{
if (eventPtr && eventPtr >= positionPtr) {
@@ -1790,7 +1790,7 @@
return position.lineNumber + 1;
}
-int XMLCALL
+XML_Size XMLCALL
XML_GetCurrentColumnNumber(XML_Parser parser)
{
if (eventPtr && eventPtr >= positionPtr) {
Index: xmltok.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- xmltok.h 26 Mar 2004 14:24:11 -0000 1.10
+++ xmltok.h 23 Dec 2005 14:45:27 -0000 1.11
@@ -111,8 +111,8 @@
typedef struct position {
/* first line and first column are 0 not 1 */
- unsigned long lineNumber;
- unsigned long columnNumber;
+ XML_Size lineNumber;
+ XML_Size columnNumber;
} POSITION;
typedef struct {
More information about the Expat-checkins
mailing list