I'm sorry the documentation is poor.
I looked into your first question.
opt_c is a enum value for the type of program calling initialization in
owlib:
enum opt_program { opt_owfs, opt_server, opt_httpd, opt_ftpd, opt_tcl,
opt_swig, opt_c,
};
I'll change the names in the next version to:
enum enum_program_type { program_type_filesystem, program_type_server,
program_type_httpd,
program_type_ftpd,
program_type_tcl, program_type_swig,
program_type_clibrary,
};
A little wordy, but clearer when seen alone.
----------------------------
Nice pickup on the optind problem, but I do have a question:
My reading of the man page is that optind should be set to 1 (not 0) to
reset scanning.
"The variable optind is the index of the next element to be processed in
argv. The system initializes this value to 1. The caller can reset it
to 1 to restart scanning of the same argv, or when scanning a new
argument vector."
Is there any reason for owcapi not to set optind to 1 before the start of
processing? It's probably a very rare case the a user would want to start
with any other value.
Paul Alfille
On Tue, Aug 9, 2011 at 8:20 PM, Mark Richards
<[email protected]>wrote:
> Ugh!
>
> Reply to self. Maybe this will help someone in future:
>
> http://old.nabble.com/owcapi-td25259061.html
>
> Namely: "OW_init also use *getopt* library (*getopt_long*) , so I needed
> to set optind = 0 after I finished my *getopt* job so it will be re
> initialized when the OW_init call will occurs"
>
> This should be documented in the owcapi docs.
>
> I will revise the docs and submit them for update.
>
> /m
>
>
>
>
> On 8/9/2011 18:15, Mark Richards wrote:
>
> I note in OW_init(const char *params) the following:
> API_setup(opt_c);
>
> opt_c is defined nowhere (that I can locate). I am guessing it is an
> library/internal global variable used by getopt.
>
> Why and I concerned with this?
>
> My application uses getopt and when I call my OW_init before my getopt the
> library works fine. Calling AFTER my getopt causes the library to fail to
> initialize. And this depends upon the number of parameters in my getopt.
>
> What is opt_c?
>
> Maybe API_setup() has something to do with this?
>
>
>
>
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at: http://p.sf.net/sfu/wandisco-dev2dev
>
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers