On Sun, Sep 22, 2013 at 11:22 AM, Tom Browder <[email protected]> wrote:
> On Fri, Sep 20, 2013 at 8:13 AM, Tom Browder <[email protected]> wrote:
..
> Ref different structs for different  arg types:  The arg type flag
> would still be required AFAIK unless we can use some C++ magic (will
> RTTI work?) on that side to disambiguate the type of struct.  Ideas?

Apparently there is a way to get RTTI in C but it takes dynamic memory--bummer!

However, maybe a macro can hide the arg type flag from the user on the
C side.  Something like:

# define BU_ARG_SWITCH (_flag_str, _name_str, _desc_str, _def_val_bool) \
{BU_SwitchArg, _flag_str, _name_str, _desc_str, _def_val_bool}

and use it like this:

static bu_arg_switch f_arg = BU_ARG_SWITCH_INIT("?", "long-help",
"more help", 0);

/* more arg defs ... */
static void *args[] = {(void*)&f_arg, (void*)&other_args, NULL};

bu_arg_parse(args, argc, argv);

-Tom

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to