[
Lists Home |
Date Index |
Thread Index
]
I vote for abstract "streaming writer" callback, no FILE* streams but
something like:
typedef int (*PFNOUTPUTCALLBACK)(void *UserData, utf8Byte *buf, int cBytes,
int *cBytesWritten);
which writer calls with every buffer it wants to write out (you can use
fwrite or whatever here).
buf has cBytes it wants to write, set cBytesWritten to actual byte count
that gets written. Returns
some error value etc.
You could also wrap for example gnu libiconv calls in this callback to
output in different encoding than UTF-8/16
(of course you have to work with UTF-8/wchar internally for name char
checking etc.). There could
be FILE* stream callback and maybe libiconv callback provided "in the box"
for genx?
I also vote for passing strlen (or -1 when you pass NUL terminated string)
for pcdata callbacks.
with respect,
Toni Uusitalo
- References:
- Genx
- From: Tim Bray <tbray@textuality.com>
|