64bit Integers for large files (Expat 2.0)
Karl Waclawek <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
This has been proposed recently. As I am not a cross-platform expert, I suggest a simple solution: A new conditional define: #ifdef XML_LARGE_SIZE /* Use large integers for counts and positions. */ typedef long long XML_Index; typedef unsigned long long XML_Size; #else typedef int XML_Index; typedef unsigned int XML_Size; #endif /* XML_LARGE_SIZE */ Most compilers will support that, and those that don't can still use the 32 bit API. This will change the API like this: XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser); XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser); XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser); XMLPARSEAPI(XML_Size) XML_GetCurrentByteCount(XML_Parser parser); Note: Even if XML_LARGE_SIZE is not defined, the above will change the return type of XML_GetCurrentLineNumber, XML_GetCurrentColumnNumber and XML_GetCurrentByteCount from int to uint! Could this be a problem? What do you think? I'd like to post a test release (for feedback purposes) soon. Karl