Hi Poul-Henning Kamp! 

On Tue, 17 May 2011 18:24:59 +0000 (UTC); Poul-Henning Kamp <[email protected]> 
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:[email protected]
[Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to