[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[help-gengetopt] options with values and enum type
From: |
Lorenzo Bettini |
Subject: |
[help-gengetopt] options with values and enum type |
Date: |
Fri, 26 Oct 2007 18:51:44 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.4 (X11/20070828) |
Hi
Gyozo, you'll be happy to hear that options with values can now be given
enum type :-)
here's an initial release
http://rap.dsi.unifi.it/~bettini/gengetopt-2.22b.tar.gz
and, of course, it's also in the CVS
see the documentation for details
actually, the implementation was quite easy, but it relies on enums
being treated as int; does any of you know whether this is safe? I
don't get warnings in compilation, thus I assumed it is safe to do so.
Notice that the option field has an enum type
Basically, when assigning the argument to such an option, I actually
assign it the index of the value found in the array of strings
containing the accepted values; this relies on the fact that the first
enum value is always 0.
I hope to get some feedback soon
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
- [help-gengetopt] options with values and enum type,
Lorenzo Bettini <=