On 10/05/16 16:33, Gustavo Sverzut Barbieri wrote: > On Fri, May 6, 2016 at 11:11 PM, Carsten Haitzler <ras...@rasterman.com> > wrote: >> On Fri, 6 May 2016 12:36:51 +0100 Tom Hacohen <t...@osg.samsung.com> said: >> 3. put a partname string just about everywhere into any api that may deal >> with >> part names (can be optional in bindings - maybe add static inlines without >> part >> param so passing NULL can be avoided with different func name) > > One pattern that I started to use on other project is to use macros > and structures, take this as an example: > > struct params { > const char *part; > Eo *obj; > int someval; > }; > > int do_call(struct params); > > #define call(...) do_call((struct params){__VA_ARGS__}) > > call(.part = "x", obj = o); > call(.obj = o); > > If you need mandatory parameters, either you split them in the macro, > or you need more machinery to check those. Like: > > #define call(o, ...) do_call((struct params){.obj = o, ## __VA_ARGS__}) > > call(o, .part = "x"); > call(o); > >
While super cool, we don't want to go back to macros, and this syntax is anyway not portable. Member initialisation is not supported in VC for all I remember. :( We have this problem with ecore getopt. -- Tom. ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel