[Expat-discuss] 64 bit integers in Expat 2.0?

Nick MacDonald nickmacd at gmail.com
Wed Nov 30 00:20:25 CET 2005


I'm guessing that people that need to support huge files (>2GB) generally
know this.  You could add some simple checking in the code.

When the file is first opened, do a stat on it and see if its too huge, and
large file support not enabled:

#ifndef EXPAT_HUGE_FILE_SUPPORT
if currentFileSize() >0xffffffff then
{
  return warningOrErrorCode;
}
#endif


Otherwise you just make a suitable type and hope that people writing new
code are willing to adapt:

#ifdef EXPAT_HUGE_FILE_SUPPORT
typedef uint64 xmlFilePos_t;
#else
typedef unit32 xmlFilePos_t;
#endif

Nick


On 11/29/05, Karl Waclawek <karl at waclawek.net> wrote:
>
>
> We are trying to decide whether we should change some API return values
> to 64 bit integers to support file sizes > 2GB. Affected would be these
> API members:
>
> XML_GetCurrentByteIndex()
> XML_GetCurrentByteCount()
> XML_GetCurrentLineNumber()
> XML_GetCurrentColumnNumber()
>
> Obviously this requires applications to be recompiled.
>
> The question is, how "breaking" would that change be?
> How many applications are actually using these members?
>
> Should this be delayed after the release of Expat 2.0?
>
> Karl
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
>



--
Nick MacDonald
NickMacD at gmail.com


More information about the Expat-discuss mailing list