Re: GTypeInfo problems..
[email protected] (Jonas Borgström) 03 Jan 2003 14:59:27 +0100
| Newsgroups | gmane.network.beep.roadrunner.general |
|---|---|
| Message-ID | <[email protected]> |
Francis Brosnan Bl=E1zquez <[email protected]> writes: > Hi. >=20 Hi, > I don't if this is the right place to ask about my problem, so excuse > me. X'D >=20 > I want to allow to configure which handler will be executed when > something happens, so I have created a public structure that has to be > passed to my GType init function. My function looks as follow: >=20 *snip* >=20 > Has anybody any idea about this? You should probably create a config struct which holds user configurable parameters. The CVS version of the sasl profile uses such an object. It works like this: http://rr.codefactory.se/cgi-bin/viewcvs.cgi/sasl/librrsasl/rr-saslconfig.h= ?rev=3D1.1&content-type=3Dtext/vnd.viewcvs-markup /* Create a configuration object */ cfg =3D rr_sasl_config_new (); /* Register a custom password callback */ rr_sasl_config_set_password_cb (cfg, ask_pass, NULL); The cfg parameter can be passed to the profile in two ways. 1: as the last parameter to the "rr_profile_registry_add_profile" function. This is the only way to pass config values to a listening peer (server). The profile can then access the value from "RR_CHANNEL (profile)->global_config". 2: configuation values can also specified for each beep channel start request as the forth parameter to rr_connection_start. The profile can access the value as: "RR_CHANNEL(profile)->instance_config" / Jonas --=20 Jonas Borgstr=F6m [email protected] CodeFactory AB http://www.codefactory.se/ Office: +46 (0)90 71 86 14