[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] E_CONFIG_SUB



Hi everybody,

Currently I'm trying to create a new module for E. Doing this I faced
with the following problem. I have the following module header:

typedef _Extra Extra;
typedef _Config Config;

struct _Extra
{
   int a;
   char *b;
};

stuct _Config
{
   int a;
   Extra *e;
};


I need to store the Config into the config file. The question is how to
deal with the sub-structure in the _Config structure. I tried to use
E_CONFIG_SUB, but I did not get any result. Unfortunatelly I did not
find any examples of using it. So, probably, I just incorectly used it.
But for me it seems to be as easy as with E_CONFIG_LIST :-\
THe following code illustrate the steps I do to load the data from
the confgi file :

E_Config_DD conf_edd;
E_Config_DD conf_extra_edd;


....
// Loading config :

   conf_extra_edd = E_CONFIG_DD_NEW("Extra_Config", Extra);
#undef T
#undef D
#define T Extra
#define D conf_extra_edd
   E_CONFIG_VAL(T, D, a, INT);
   E_CONFIG_VAL(T, D, b, STR);

   conf_edd = E_CONFIG_DD_NEW("Module_Config", Config);
#undef T
#undef D
#define T Config
#define D conf_edd
   E_CONFIG_VAL(T, D, a, INT);
   E_CONFIG_SUB(T, D, e, conf_extra_edd);

   m->conf = e_config_domain_load("module.somemodule", conf_edd);
   if (!m->conf)
     {
	...
     }
...


What can be wrong with this code ?  Please help :)

sn