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);


-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (19) 99225-2202
Contact: http://www.gustavobarbieri.com.br/contact

------------------------------------------------------------------------------
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

Reply via email to