Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] String buffers added to emem.[ch]

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Fri, 27 Mar 2009 16:18:32 -0700
I just checked in support for string buffers to emem.[ch], which are growable
strings similar to GStrings. You can use them to do things like the following:


emem_strbuf_t *strbuf;

strbuf = ep_strbuf_new_label("Flags: ");

ep_strbuf_printf_append(strbuf, "%s (%04x)", "lemons", 2);
ep_strbuf_printf_append(strbuf, ", %s (%04x)", "marmots", 32);

proto_tree_add_uint_format(tcp_tree, hf_fruits_mammals, tvb, offset, 2,
	flags, "%s (%04x)", strbuf->str, flags);


More information can be found in README.malloc and emem.h.

-- 
Join us for Sharkfest’09  |  Stanford University, June 15 – 18
http://www.cacetech.com/sharkfest.09/