Re: [xml] Setting default buffer size for input callbacks



On Tue, Jul 13, 2004 at 04:55:05PM -0700, Your Name wrote:
Hello -

I'm writing a set of I/O callbacks for libxml which read very large
files.   It seems the current default buffer size when reading through a
callback is 4KB.  I'd like to change this value to something like 16MB.

  The simplest seems to provide your own I/O handler. See
    http://xmlsoft.org/examples/index.html#io1.c
for an example.

Sorry, I guess I should have been more specific ;)

I've already implemented my callbacks using the I/O handler interface. 
For instance, I have a function:

  static int BigFileRead(void* context, char* buffer, int len) {
    if (context == NULL) return -1;
    File* file = (File*)context;
    return file->Read(buffer, len);
  }

My issue is that the "len" parameter seems to be automagically set to
4000 bytes.  I would like it to be something more like 1<<20 bytes.  

The only places I can find the 4000 byte len defined are in tree.h and
xmlIO.c, but these are both #define's and I can't seem to override them.

Is there any way for me to up this "len" parameter so my BigFileRead
function gets called with a larger value?

Thanks again,

Andrew



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]