svn commit: r222034 - head/share/man/man9

Vadim Goncharov vadim_nuclight at mail.ru
Thu May 19 10:21:49 UTC 2011


Hi Poul-Henning Kamp! 

On Tue, 17 May 2011 18:24:59 +0000 (UTC); Poul-Henning Kamp <phk at FreeBSD.org> wrote:

> Author: phk
> Date: Tue May 17 18:24:59 2011
> New Revision: 222034
> URL: http://svn.freebsd.org/changeset/base/222034

> Log:
>   Try to explain what sbufs do and add an example to show it.
[...]   
> +.Sh EXAMPLES
> +.Bd -literal -compact
> +#include <sys/sbuf.h>
> +
> +struct sbuf *sb;
> +
> +sb = sbuf_new_auto();
> +sbuf_cat("Customers found:\en");
> +TAILQ_FOREACH(foo, &foolist, list) {
> +	sbuf_printf("   %4d %s\en", foo->index, foo->name);
> +	sbuf_printf("      Address: %s\en", foo->address);
> +	sbuf_printf("      Zip: %s\en", foo->zipcode);
> +}
> +if (sbuf_finish(sb))
> +	err(1,"Could not generate message");
> +transmit_msg(sbuf_data(sb), sbuf_len(sb));
> +sbuf_delete(sb);

The 'sb' variable is not used in some sbuf_*() funcs in the example,
is this intended?

-- 
WBR, Vadim Goncharov. ICQ#166852181       mailto:vadim_nuclight at mail.ru
[Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]


More information about the svn-src-all mailing list