1
Fork 0

Added missing files.

This commit is contained in:
davi 2005-01-18 17:10:28 +00:00
parent c902bb96d0
commit ac4a2f539f
5 changed files with 602 additions and 139 deletions

188
ChangeLog
View File

@ -1,159 +1,69 @@
2004-11-24 12:42 davi 2005-01-18 10:18 davi
* src/czech.c: Fixed some leaks. * COPYING, INSTALL, src/Makefile.am, src/bmz.c, src/bmz.h,
src/cmph.c, src/cmph.h, src/cmph_structs.c, src/cmph_structs.h,
src/czech.c, src/czech.h, src/debug.h, src/djb2_hash.c,
src/graph.c, src/graph.h, src/hash.c, src/jenkins_hash.c,
src/main.c, src/sdbm_hash.c, src/vqueue.c: Fixed a lot of warnings.
Added visual studio project. Make needed changes to work with
windows.
2004-11-24 11:34 davi 2005-01-17 16:01 fc_botelho
* src/: Makefile.am, cmph.h, cmph_types.h, czech.h, graph.h, * src/main.c: stable version
hash.h, jenkins_hash.h, types.h, vstack.h: Better header layout.
2004-11-23 15:15 davi 2005-01-17 15:58 fc_botelho
* src/jenkins_hash.c: Fixed trivial bug. * src/: bmz.c, cmph.c, cmph.h, graph.c: stable version
2004-11-04 00:56 davi 2005-01-13 21:56 davi
* src/: czech.c, graph.c: Forgot. * src/czech.c: Better error handling in czech.c.
2004-11-04 00:09 davi 2005-01-05 18:45 fc_botelho
* src/: cmph.c, cmph.h, czech.c, czech.h, graph.c, main.c: Fixed * src/cmph_structs.c: included option -k to specify the number of
small bug due to fgets trick. keys to use
2004-11-03 23:15 davi 2005-01-05 17:48 fc_botelho
* src/: cmph.c, cmph.h, cmph_structs.c, cmph_structs.h, czech.c, * src/: cmph.c, main.c: included option -k to specify the number of
main.c: Added verbosity option keys to use
2004-11-03 22:42 davi 2005-01-03 19:38 fc_botelho
* src/czech.c: [no log message] * src/bmz.c: using less memory
2004-11-03 20:57 davi 2005-01-03 18:47 fc_botelho
* src/: Makefile.am, fnv_hash.c, fnv_hash.h, hash.c, hash_state.h: * src/: bmz.c, graph.c: using less space to store the used_edges
Added fnv hash function. and critical_nodes arrays
2004-11-03 18:10 davi 2004-12-23 11:16 davi
* src/: Makefile.am, cmph.c, cmph.h, czech.c, czech.h, djb2_hash.c, * INSTALL, COPYING, AUTHORS, ChangeLog, Makefile.am, NEWS, README,
hash.c, hash_state.h, jenkins_hash.c, main.c, sdbm_hash.c, cmph.spec, configure.ac, src/graph.c, tests/Makefile.am,
sdbm_hash.h: Added sdbm hash function. tests/graph_tests.c, src/bmz.c, src/cmph_types.h,
src/czech_structs.h, src/hash_state.h, src/jenkins_hash.c,
src/bmz_structs.h, src/cmph.c, src/cmph.h, src/cmph_structs.h,
src/czech.c, src/debug.h, src/djb2_hash.c, src/djb2_hash.h,
src/fnv_hash.c, src/fnv_hash.h, src/graph.h, src/hash.c,
src/hash.h, src/jenkins_hash.h, src/sdbm_hash.c, src/vstack.h,
src/Makefile.am, src/bmz.h, src/cmph_structs.c, src/czech.h,
src/main.c, src/sdbm_hash.h, src/vqueue.c, src/vqueue.h,
src/vstack.c: Initial release.
2004-11-03 15:53 davi 2004-12-23 11:16 davi
* src/cmph.c, src/cmph.h, src/cmph_structs.c, src/cmph_structs.h, * INSTALL, COPYING, AUTHORS, ChangeLog, Makefile.am, NEWS, README,
src/czech.c, src/czech.h, src/czech_structs.h, src/main.c, cmph.spec, configure.ac, src/graph.c, tests/Makefile.am,
tests/Makefile.am, tests/czech_tests.c: Added callback structure to tests/graph_tests.c, src/bmz.c, src/cmph_types.h,
retrieve keys in disk. src/czech_structs.h, src/hash_state.h, src/jenkins_hash.c,
src/bmz_structs.h, src/cmph.c, src/cmph.h, src/cmph_structs.h,
2004-10-31 22:57 davi src/czech.c, src/debug.h, src/djb2_hash.c, src/djb2_hash.h,
src/fnv_hash.c, src/fnv_hash.h, src/graph.h, src/hash.c,
* src/: Makefile.am, djb2_hash.c, djb2_hash.h, hash.c, hash.h, src/hash.h, src/jenkins_hash.h, src/sdbm_hash.c, src/vstack.h,
hash_funcs.h, jenkins_hash.h: Added new hash function. src/Makefile.am, src/bmz.h, src/cmph_structs.c, src/czech.h,
src/main.c, src/sdbm_hash.h, src/vqueue.c, src/vqueue.h,
2004-10-31 20:53 davi src/vstack.c: Initial revision
* src/main.c: Added random seed.
2004-10-31 20:48 davi
* src/main.c, tests/czech_tests.c: Better getopt code.
2004-10-31 19:27 davi
* src/: cmph.c, cmph.h, cmph_structs.c, cmph_structs.h, czech.c,
czech.h, czech_structs.h, hash.c, hash.h, jenkins_hash.c,
jenkins_hash.h, main.c: Everything working flawlessly.
2004-10-30 20:12 davi
* src/cmph_structs.c: Added missing file.
2004-10-30 20:09 davi
* src/main.c: forgot.
2004-10-29 19:02 davi
* src/: Makefile.am, cmph.c, cmph.h, cmph_structs.h, czech.c,
czech.h, czech_structs.h, graph.c, hash.c, hash.h, jenkins_hash.c,
jenkins_hash.h, main.c: Cleaned some warnings.
2004-10-29 16:14 davi
* src/: hash.c, hash_state.h: Missing file.
2004-10-29 14:18 davi
* src/: Makefile.am, cmph.c, cmph.h, czech.c, graph.c, hash.h,
jenkins_hash.c, jenkins_hash.h, jenkinshash.c, jenkinshash.h:
Working nice. Serialization almost there.
2004-10-28 11:21 davi
* Makefile.am, src/cmph.c, src/cmph_structs.h, src/czech.c,
src/czech_structs.h, src/jenkinshash.c: Hash generation seems to be
working fine.
2004-10-27 15:19 davi
* src/hash.h: Added hash header.
2004-10-27 15:06 davi
* COPYING, INSTALL, Makefile.am, src/czech.c, src/czech_structs.h,
src/graph.c, src/graph.h, src/vstack.c, tests/Makefile.am,
tests/czech_tests.c, tests/graph_tests.c: Cool. Now it is
serialization time.
2004-10-27 13:06 davi
* tests/: czech_tests.c, keys: Added missing files.
2004-10-26 21:23 davi
* src/graph.c, tests/Makefile.am: Still working on f*cking graph
implementation.
2004-10-25 20:05 davi
* src/: cmph.c, cmph.h, cmph_structs.h, czech.c, czech.h,
czech_structs.h, graph.c, graph.h, jenkinshash.c, jenkinshash.h,
vstack.c: Added some new files.
2004-10-25 00:27 davi
* src/: czech.c, czech.h, graph.c, graph.h, jenkinshash.c: Some
random code.
2004-10-24 23:07 davi
* src/: Makefile.am, debug.h, graph.c, main.c, vstack.c, vstack.h:
Added stack implementation.
2004-10-24 21:57 davi
* src/list.h: Added missing file.
2004-10-24 21:50 davi
* src/types.h: Added missing file.
2004-10-22 20:30 davi
* src/: Makefile.am, cmph.h, czech.c, czech.h, graph.c, graph.h,
jenkinshash.c, jenkinshash.h: Added a lot of files.
2004-10-19 17:08 davi
* AUTHORS, COPYING, ChangeLog, INSTALL, Makefile.am, NEWS, README,
cmph.spec, configure.ac, src/Makefile.am, src/cmph.c, src/cmph.h,
src/main.c, tests/Makefile.am: Initial revision
2004-10-19 17:08 davi
* AUTHORS, COPYING, ChangeLog, INSTALL, Makefile.am, NEWS, README,
cmph.spec, configure.ac, src/Makefile.am, src/cmph.c, src/cmph.h,
src/main.c, tests/Makefile.am: Minimum perfect hashing library

210
cmph.vcproj Normal file
View File

@ -0,0 +1,210 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="cmph"
ProjectGUID="{F215E028-2FB8-41DE-B211-8E4616CF5B59}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/cmph.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/cmph.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\src\bmz.c">
</File>
<File
RelativePath=".\src\cmph.c">
</File>
<File
RelativePath=".\src\cmph_structs.c">
</File>
<File
RelativePath=".\src\czech.c">
</File>
<File
RelativePath=".\src\djb2_hash.c">
</File>
<File
RelativePath=".\src\fnv_hash.c">
</File>
<File
RelativePath=".\src\graph.c">
</File>
<File
RelativePath=".\src\hash.c">
</File>
<File
RelativePath=".\src\jenkins_hash.c">
</File>
<File
RelativePath=".\src\sdbm_hash.c">
</File>
<File
RelativePath=".\src\vqueue.c">
</File>
<File
RelativePath=".\src\vstack.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\src\bmz.h">
</File>
<File
RelativePath=".\src\bmz_structs.h">
</File>
<File
RelativePath=".\src\cmph.h">
</File>
<File
RelativePath=".\src\cmph_structs.h">
</File>
<File
RelativePath=".\src\cmph_types.h">
</File>
<File
RelativePath=".\src\czech.h">
</File>
<File
RelativePath=".\src\czech_structs.h">
</File>
<File
RelativePath=".\src\debug.h">
</File>
<File
RelativePath=".\src\djb2_hash.h">
</File>
<File
RelativePath=".\src\fnv_hash.h">
</File>
<File
RelativePath=".\src\graph.h">
</File>
<File
RelativePath=".\src\hash.h">
</File>
<File
RelativePath=".\src\hash_funcs.h">
</File>
<File
RelativePath=".\src\hash_state.h">
</File>
<File
RelativePath=".\src\jenkins_hash.h">
</File>
<File
RelativePath=".\src\list.h">
</File>
<File
RelativePath=".\src\sdbm_hash.h">
</File>
<File
RelativePath=".\src\vqueue.h">
</File>
<File
RelativePath=".\src\vstack.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

141
cmphapp.vcproj Normal file
View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="cmphapp"
ProjectGUID="{5CD55126-9AC1-4393-B26B-AB3DFB2A9AD6}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cmphapp.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cmphapp.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cmphapp.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\src\main.c">
</File>
<File
RelativePath=".\wingetopt.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\wingetopt.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

177
wingetopt.c Normal file
View File

@ -0,0 +1,177 @@
/*****************************************************************************
*
* MODULE NAME : GETOPT.C
*
* COPYRIGHTS:
* This module contains code made available by IBM
* Corporation on an AS IS basis. Any one receiving the
* module is considered to be licensed under IBM copyrights
* to use the IBM-provided source code in any way he or she
* deems fit, including copying it, compiling it, modifying
* it, and redistributing it, with or without
* modifications. No license under any IBM patents or
* patent applications is to be implied from this copyright
* license.
*
* A user of the module should understand that IBM cannot
* provide technical support for the module and will not be
* responsible for any consequences of use of the program.
*
* Any notices, including this one, are not to be removed
* from the module without the prior written consent of
* IBM.
*
* AUTHOR: Original author:
* G. R. Blair (BOBBLAIR at AUSVM1)
* Internet: bobblair@bobblair.austin.ibm.com
*
* Extensively revised by:
* John Q. Walker II, Ph.D. (JOHHQ at RALVM6)
* Internet: johnq@ralvm6.vnet.ibm.com
*
*****************************************************************************/
/******************************************************************************
* getopt()
*
* The getopt() function is a command line parser. It returns the next
* option character in argv that matches an option character in opstring.
*
* The argv argument points to an array of argc+1 elements containing argc
* pointers to character strings followed by a null pointer.
*
* The opstring argument points to a string of option characters; if an
* option character is followed by a colon, the option is expected to have
* an argument that may or may not be separated from it by white space.
* The external variable optarg is set to point to the start of the option
* argument on return from getopt().
*
* The getopt() function places in optind the argv index of the next argument
* to be processed. The system initializes the external variable optind to
* 1 before the first call to getopt().
*
* When all options have been processed (that is, up to the first nonoption
* argument), getopt() returns EOF. The special option "--" may be used to
* delimit the end of the options; EOF will be returned, and "--" will be
* skipped.
*
* The getopt() function returns a question mark (?) when it encounters an
* option character not included in opstring. This error message can be
* disabled by setting opterr to zero. Otherwise, it returns the option
* character that was detected.
*
* If the special option "--" is detected, or all options have been
* processed, EOF is returned.
*
* Options are marked by either a minus sign (-) or a slash (/).
*
* No errors are defined.
*****************************************************************************/
#include <stdio.h> /* for EOF */
#include <string.h> /* for strchr() */
/* static (global) variables that are specified as exported by getopt() */
extern char *optarg; /* pointer to the start of the option argument */
extern int optind; /* number of the next argv[] to be evaluated */
extern int opterr; /* non-zero if a question mark should be returned
when a non-valid option character is detected */
/* handle possible future character set concerns by putting this in a macro */
#define _next_char(string) (char)(*(string+1))
int getopt(int argc, char *argv[], char *opstring)
{
static char *pIndexPosition = NULL; /* place inside current argv string */
char *pArgString = NULL; /* where to start from next */
char *pOptString; /* the string in our program */
if (pIndexPosition != NULL) {
/* we last left off inside an argv string */
if (*(++pIndexPosition)) {
/* there is more to come in the most recent argv */
pArgString = pIndexPosition;
}
}
if (pArgString == NULL) {
/* we didn't leave off in the middle of an argv string */
if (optind >= argc) {
/* more command-line arguments than the argument count */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* used up all command-line arguments */
}
/*---------------------------------------------------------------------
* If the next argv[] is not an option, there can be no more options.
*-------------------------------------------------------------------*/
pArgString = argv[optind++]; /* set this to the next argument ptr */
if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */
('-' != *pArgString)) {
--optind; /* point to current arg once we're done */
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* used up all the command-line flags */
}
/* check for special end-of-flags markers */
if ((strcmp(pArgString, "-") == 0) ||
(strcmp(pArgString, "--") == 0)) {
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* encountered the special flag */
}
pArgString++; /* look past the / or - */
}
if (':' == *pArgString) { /* is it a colon? */
/*---------------------------------------------------------------------
* Rare case: if opterr is non-zero, return a question mark;
* otherwise, just return the colon we're on.
*-------------------------------------------------------------------*/
return (opterr ? (int)'?' : (int)':');
}
else if ((pOptString = strchr(opstring, *pArgString)) == 0) {
/*---------------------------------------------------------------------
* The letter on the command-line wasn't any good.
*-------------------------------------------------------------------*/
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return (opterr ? (int)'?' : (int)*pArgString);
}
else {
/*---------------------------------------------------------------------
* The letter on the command-line matches one we expect to see
*-------------------------------------------------------------------*/
if (':' == _next_char(pOptString)) { /* is the next letter a colon? */
/* It is a colon. Look for an argument string. */
if ('\0' != _next_char(pArgString)) { /* argument in this argv? */
optarg = &pArgString[1]; /* Yes, it is */
}
else {
/*-------------------------------------------------------------
* The argument string must be in the next argv.
* But, what if there is none (bad input from the user)?
* In that case, return the letter, and optarg as NULL.
*-----------------------------------------------------------*/
if (optind < argc)
optarg = argv[optind++];
else {
optarg = NULL;
return (opterr ? (int)'?' : (int)*pArgString);
}
}
pIndexPosition = NULL; /* not in the middle of anything */
}
else {
/* it's not a colon, so just return the letter */
optarg = NULL; /* no argument follows the option */
pIndexPosition = pArgString; /* point to the letter we're on */
}
return (int)*pArgString; /* return the letter that matched */
}
}

25
wingetopt.h Normal file
View File

@ -0,0 +1,25 @@
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WIN32
#include <getopt.h>
#else
#ifndef _GETOPT_
#define _GETOPT_
#include <stdio.h> /* for EOF */
#include <string.h> /* for strchr() */
char *optarg = NULL; /* pointer to the start of the option argument */
int optind = 1; /* number of the next argv[] to be evaluated */
int opterr = 1; /* non-zero if a question mark should be returned */
int getopt(int argc, char *argv[], char *opstring);
#endif
#endif
#ifdef __cplusplus
}
#endif