Date: Thu, 19 May 2011 17:21:39 +0700 From: Vadim Goncharov <vadim_nuclight@mail.ru> To: svn-src-all@freebsd.org Cc: Poul-Henning Kamp <phk@freebsd.org> Subject: Re: svn commit: r222034 - head/share/man/man9 Message-ID: <201105191021.p4JALe6Y098298@kernblitz.nuclight.avtf.net> In-Reply-To: =?UTF-8?Q?=3C201105171824=2Ep4HIOxHY042152=5F=5F8393=2E2816?= =?UTF-8?Q?786275=241305656744=24gmane=24org=40svn=2Efreebsd=2Eorg=3E?= References: <201105171824.p4HIOxHY042152__8393.2816786275$1305656744$gmane$org@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Poul-Henning Kamp! On Tue, 17 May 2011 18:24:59 +0000 (UTC); Poul-Henning Kamp <phk@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@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105191021.p4JALe6Y098298>