[vorbis-dev] Please gix getopt

Jeff Squyres jsquyres at lsc.nd.edu
Sun Feb 11 10:31:51 PST 2001



I don't think that the getopt_long() situation is handled correctly in the
vorbis-tools module.  Here's my take (comments welcome!).

-----

This applies to oggenc, ogg123, and vorbiscomment.  See
http://www.xiph.org/archives/vorbis-dev/200012/0359.html for background
and prior discussion on this issue.

There are 2 issues:

1. Summary: getopt() is a POSIX function.  It will already be on every OS
that these apps are compiled for.  getopt_long() is GNU-specific, and
needs to be provided on many OS's.  The question is how to do this
Correctly.

*** It is dangerous to replace system functions ***

If the authors are resistant to putting in configure tests for the
getopt_long() function, it would be *MUCH* better to prefix all the
symbols in getopt.c, getopt.h, and getopt1.c with "ov_" to prevent
collisions with any potential OS versions of the same functions.  This
would both obviate the need for any configure tests, and would guarantee
that there were safe versions of the functions for ogg123, oggenc, and
vorbiscomment to use.  Also, <ov_getopt.h> would always be found (some
OS's don't have <getopt.h>).

2. Summary: getopt.c, getopt.h, and getopt1.c are included in both oggenc
and ogg123.  It seems that vorbiscomment uses getopt_long(), so it seems
that vorbiscomment needs them too.  But including them in vorbiscomment is
a mistake (IMO); a better solution should be used.

Regardless of what is decided about the above comments, it is a Bad Idea
to have all three applications have their own copies of the getopt* files.
If only oggenc and ogg123 were going to use them, that might be ok, but
when *three* separate applications use them, I think that's a critical
mass to make those functions into a standalone library in vorbis-tools
that is linked to by all three vorbis-tools applications.  This is trivial
to do in automake.

{+} Jeff Squyres
{+} squyres at cse.nd.edu
{+} Perpetual Obsessive Notre Dame Student Craving Utter Madness
{+} "I came to ND for 4 years and ended up staying for a decade"

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list