Wireshark-dev: Re: [Wireshark-dev] How do I initialise a boolean preference

From: "Hal Lander" <hal_lander@xxxxxxxxxxx>
Date: Mon, 29 Jan 2007 00:49:32 -0900
What name did you register your preferences module under, and what
name did you register your preference under?

Code snip below.

proto_foo = proto_register_protocol("My protocol","FOO", "foo");
foo_module = prefs_register_protocol(proto_foo, proto_reg_handoff_foo);
prefTick=TRUE;
prefs_register_bool_preference(foo_module,"tick","MyTitle","MyDescription",&prefTick);

Hal

From: Guy Harris <guy@xxxxxxxxxxxx>
Reply-To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Subject: Re: [Wireshark-dev] How do I initialise a boolean preference
Date: Mon, 22 Jan 2007 15:23:02 -0800


On Jan 22, 2007, at 7:24 AM, Hal Lander wrote:

> I start Wireshark (don't open a file or anything).
> My dissector's proto_reg_handoff routine is called.
> In the code that runs only once I initialise a variable
>    static gboolean prefTick
> to TRUE, and register the preference.

What name did you register your preferences module under, and what
name did you register your preference under?


> Before returning the variable is printed out and it is TRUE.
>
> My dissector's proto_reg_handoff routine is called a second time (I
> have not done anything in the Wireshark window yet).

Do you call it yourself from any other routines in your dissector?

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev

_________________________________________________________________
Check out all that glitters with the MSN Entertainment Guide to the Academy Awards� http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline2