A DOS-version of the getopt_long function

Copyright (C) 2001 Jim Hall, jhall@freedos.org

----------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
----------------------------------------------------------------------


The getopt_long() function works like getopt() except that it also
accepts long options, started out by a slash char.

The getopt_long() function returns the option character if the
option was found successfully, ':' if there was a missing parameter
for one of the options, '?' for an unknown option character, or EOF
for the end of the option list.

getopt_long_only() returns the option character when a short option
is recognized.  For a long option, they return val if flag is NULL,
and 0 otherwise.  Error and EOF returns are the same as for getopt(),
plus '?' for an ambiguous match or an extraneous parameter.

See the foo.c sample program to see how to use getopt_long.

----------------------------------------------------------------------
CHANGES FROM THE GNU getopt_long() FUNCTION:
----------------------------------------------------------------------

I have not yet implemented all features from GNU getopt_long.

This getopt_long does not honor arguments to options, so ':' in
optstring is ignored, as is has_arg in longopts.  Note that this
implies "/:" is a valid option for getopt_long (this is a bug).

Also, flag is not used in longopts.  longindex is not yet used.

These should be implemented in a future version of getopt_long.
