Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2015 00:05:39 -0500
From:      Phil Shafer <phil@juniper.net>
To:        Alfred Perlstein <bright@mu.org>
Cc:        Marcel Moolenaar <marcel@freebsd.org>, John-Mark Gurney <jmg@funkthat.com>, Alfred Perlstein <alfred@freebsd.org>, "Simon J. Gerraty" <sjg@juniper.net>, "arch@freebsd.org" <arch@freebsd.org>, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-arch <freebsd-arch@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>
Subject:   Re: Libxo bugs and fixes.
Message-ID:  <201501040505.t0455dMr079659@idle.juniper.net>
In-Reply-To: <549F742D.3000802@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501040505.t0455dMr079659>