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/
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to