comparison src/XGetopt.c @ 118:0f1492b7fe8b

patch from Fridrich Strba for building on mingw and general cleanup of autoconf files add processing for pst files of type 0x0f start adding support for properly building and installing libpst.so and the header files required to use it. remove version.h since the version number is now in config.h more const correctness issues regarding getopt()
author Carl Byington <carl@five-ten-sg.com>
date Sat, 31 Jan 2009 12:12:36 -0800
parents c508ee15dfca
children ab2a11e72250
comparison
equal deleted inserted replaced
117:0a3d854b53f6 118:0f1492b7fe8b
16 // or implied warranty. I accept no liability for any 16 // or implied warranty. I accept no liability for any
17 // damage or loss of business that this software may cause. 17 // damage or loss of business that this software may cause.
18 // 18 //
19 /////////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////////
20 20
21 #ifndef __MINGW32__ /* mingw has getopt() */
22
21 #include <stdio.h> 23 #include <stdio.h>
22 #include <string.h> 24 #include <string.h>
23 #include "XGetopt.h" 25 #include "XGetopt.h"
24 26
25 /////////////////////////////////////////////////////////////////////////////// 27 ///////////////////////////////////////////////////////////////////////////////
29 // 31 //
30 // NAME 32 // NAME
31 // getopt -- parse command line options 33 // getopt -- parse command line options
32 // 34 //
33 // SYNOPSIS 35 // SYNOPSIS
34 // int getopt(int argc, char *argv[], char *optstring) 36 // int getopt(int argc, char* const* argv, const char *optstring)
35 // 37 //
36 // extern char *optarg; 38 // extern char *optarg;
37 // extern int optind; 39 // extern int optind;
38 // 40 //
39 // DESCRIPTION 41 // DESCRIPTION
133 /////////////////////////////////////////////////////////////////////////////// 135 ///////////////////////////////////////////////////////////////////////////////
134 136
135 char *optarg; // global argument pointer 137 char *optarg; // global argument pointer
136 int optind = 0; // global argv index 138 int optind = 0; // global argv index
137 139
138 int getopt(int argc, char *argv[], char *optstring) 140 int getopt(int argc, char* const* argv, char *optstring)
139 { 141 {
140 static char *next = NULL; 142 static char *next = NULL;
141 char c, *cp; 143 char c, *cp;
142 if (optind == 0) 144 if (optind == 0)
143 next = NULL; 145 next = NULL;
144 146
145 optarg = NULL; 147 optarg = NULL;
195 } 197 }
196 } 198 }
197 199
198 return c; 200 return c;
199 } 201 }
202
203 #endif /* !__MINGW32__ */