Wireshark mailing list archives

Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script.


From: David Young <dyoung () pobox com>
Date: Tue, 4 Oct 2011 13:49:50 -0500

On Tue, Oct 04, 2011 at 11:38:48AM -0700, Dirk Jagdmann wrote:
I propose to use a perl script to automate as much as reasonable the
replacement of TRUE/FALSE in the encoding parameter of the
proto_tree_add_item() calls in dissectors as follows:

sounds good, but may be difficult to write. Because you would need
to write a parser for C function calls in perl. regular expressions
won't do the trick, as they can not reliably match parenthesi. Also
keep in mind that those proto_tree_*() functions can use multiple
lines. But just doing regular expression may give you 90% of the
cases which would be good enough.

Sounds like a perfect job for Coccinelle, <http://coccinelle.lip6.fr/>.

Dave

-- 
David Young             OJC Technologies is now Pixo
dyoung () pixotech com     Urbana, IL   (217) 344-0444 x24
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: