confuse-devel
[Top][All Lists]
Advanced

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

Re: [Confuse-devel] Read/Write compressed files


From: Simon Morris
Subject: Re: [Confuse-devel] Read/Write compressed files
Date: Wed, 2 Nov 2005 20:18:42 +0000

It would definately be handy to have wrappers for I/O functions in libconfuse... In the meantime I achieved something similar by simply patching libconfuse to use an alternative file interface (one that handles compressed file buffer streams)

I just added the following to the bottom of "config.h"

// include the headers first so that they aren't redefined
#include <stdio.h>
extern void*    file_open(const char* filename, const char* mode);
extern int        file_close(void* fp);
extern int        file_getc(void* fp);
extern int        file_read(void* buffer, size_t size, size_t count, void* fp);

#define fopen    file_open
#undef getc
#define getc    file_getc
#define fclose    file_close
#define fread    file_read

#undef ferror
#define ferror(_fp)    0

It's not the most elegant solution, but it works for my purposes!

Hope that might be of use
Cheers
Simon Morris

On 10/31/05, Ricardo Biloti <address@hidden > wrote:
Hi

I have been using libConfuse to parse files which describe physical
models. Those files can be quite large (~10Mb). I wonder if it would
be possible to extend libconfuse to employ optionally zlib, in such
way compressed files could be transparently handled.

Best regards,
--
Ricardo Biloti
Department of Applied Mathematics
IMECC/UNICAMP


_______________________________________________
Confuse-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/confuse-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]