[barcode] Patch to get output in strings

Alessandro Rubini rubini@gnu.org
Sun, 11 Nov 2001 20:30:14 +0100


> I'm thinking about writing a Perl module to interface with the barcode
> library, and I thought it'd be nice to be able to have output returned
> in a string instead of just output to a file.

Yes, that's something that was already suggested. I'll look at your patch
and consider inclusion, but I'll delay it a while.

> I've not patched any of the documents, since I don't like writing
> docs and didn't want to waste the time if this idea is rejected. :)
> If you guys find it acceptable, I'll gladly patch the docs, too.

Great, thanks. FYI, the source file for docs is doc/doc.barcode.

> This of course introduces a dependency on snprintf and also on realloc.

I had to remove one snprintf because one the Unixen people was using
didn't have it. I'm fairly reluctant to provide a replacement (too
time required to look for one and integrate in the autoconf mechanism)
or to single out systems that miss the function.

What about a function that uses a caller-provided string? Than it's
the application's reponsibility to do buffer management. Otherwise,
the caller can provide a printf-like callback (using a different
library call). The internal print-to-provided-buffer would be
implemented using the print-using-callback implementation.

> Next week I'll test it on some other platforms (IRIX, AIX, MacOS X,
> maybe others; I don't know yet).

Very good.

> The patch is a little large (~15.5kB), so I've compressed it with bzip2. If
> I should deliver it in some other way, please let me know.

To list is fine with me. We have a limit at 50k or so; everything
below that is acceptable in my opinion, even to people behind a slow
modem (like I myself am in non-office hours).

/alessandro