Libxo bugs and fixes.

Phil Shafer phil at juniper.net
Sun Jan 4 05:06:02 UTC 2015


Alfred Perlstein writes:
>Solaris and glibc have a private libc function to check if a stream is 
>line buffered called int __flbf (FILE *stream) which returns true/false 
>if the stream if line buffered or not.

I dislike using a non-standard function like this.  I'd prefer the
caller flag this information on the handle. There's already a flag
one can set on a handle that will trigger a call to flush data
buffered in the handle to the write function.  I'll add a function
to set a custom flusher, which will be called at appropriate times.
Apps like netstat will know if they need iterative output, and can
decide to set the XOF_FLUSH flag with a flusher callback.  If needed,
that callback can use __flbf.

>One other topic, I talked to some webdevs and they suggested that we 
>have a "jsonLD" which stands for "json line delimited" that would be 
>useful for periodic output.  This would be halfway between a "pretty 
>format" and a compact stream format.  meaning that each line would be a 
>record, example:

I can certainly add this, but the interesting issue would be how
to form/reform the hierarchy surrounding the iterative output.
Simplest case would be that the caller is resonsible for this, and
the libxo just provides a flag to enable this and a function to say
"this is a object".

Thanks,
 Phil


More information about the freebsd-arch mailing list