On Sep 4, 2013, at 2:12 PM, Tom Browder wrote:
> I will need a short example of how the wrapping is to be implemented in order
> to proceed, otherwise the argtable route now seems best to me to stay with C
> code.
Imagine a simplified version of the argtable API with a "bu_" prefix, calling
tclap. Not exactly the way to proceed, but the notion is similar. We could
use argtable as-is on the backend, but using MIT/BSD-licensed third-party
dependencies does keep more options open down the road.
Cliff's preliminary thoughts are looking on track, though I think we'll need a
concrete example hashed out in C from the caller's perspective, perhaps
src/proc-db/wavy.c, to keep an eye on what the end-result will look like.
Test-driven development ftw. ;)
It'd probably start looking something like:
struct bu_opt_bool dopt = {BU_OPT_MAGIC, "d", "debug", NULL, "enable memory
debugging", 0, 0};
struct bu_opt_float hopt = {BU_OPT_MAGIC, "h", "hscale", &hscale, "horizontal
scale factor", 0, 1.0}
bu_opt_table_t opts[] = {dopt, hopt, NULL};
...
err = bu_opt_parse(opts, argc, argv);
if (err > 0)
bu_exit(1, "Usage: %s %s\n", bu_getprogname(), bu_opt_synopsis(opts));
if (dopt->count > 0)
RTG.debug |= DEBUG_MEM | DEBUG_MEM_FULL;
...
bu_opt_free(opts);
Cheers!
Sean
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel