Plugin interface: Information and Version

edscott wilson garcia edscott at lunar-linux.org
Tue Nov 25 18:42:56 CET 2003


On Tue, 2003-11-25 at 11:32, Benedikt Meurer wrote:
> > I wanted to use a struct, allowing all members to be NULL. New info can
> > simply be added at the end without breaking old apps:
> > 
> > typedef struct
> > {
> >   char *name;
> >   char *version;
> >   char *maintainer;
> >   char *website;
> >   char *description; 
> > }
> > XfcePluginInfo;
> > 
> > void (*fill_plugin_info)(XfcePluginInfo *info);
> 
> Not sure, but maybe its safer to do:
> 
> typedef struct {
> 	char* name;
> 	char* version;
> 	char* maintainer;
> 	char* website;
> 	char* description;
> 	char* reserved[10];
> } XfcePluginInfo;
> 
> That'll reserve space for 10 additional pointers and will work in any 
> case I think. I'm not sure if all C compilers allow smooth additions of 
> new members to the end of a structure without breaking things. Anyone 
> with exact infos on this topic?

Why not a single gpointer? You can always use that pointer to save an
array of pointers or whatever.






More information about the Xfce4-dev mailing list