summaryrefslogtreecommitdiff
path: root/support/popt.c
diff options
context:
space:
mode:
authorErik Troan <ewt@src.gnome.org>1998-02-17 16:46:14 +0000
committerErik Troan <ewt@src.gnome.org>1998-02-17 16:46:14 +0000
commit8803da4fbc5aee8cd0fee6335d484b7b99b65f57 (patch)
tree7df6430c31a9baa609936ec6b616f27edbaddd0d /support/popt.c
parent2a5458a1727d4b8c1c95f608bdc235cc52a61034 (diff)
downloadgnome-common-8803da4fbc5aee8cd0fee6335d484b7b99b65f57.tar.gz
1) added autoconf for popt directory to make archive
2) version 2.4.103 svn path=/trunk/; revision=85
Diffstat (limited to 'support/popt.c')
-rw-r--r--support/popt.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/support/popt.c b/support/popt.c
index d75a5e1..8029d60 100644
--- a/support/popt.c
+++ b/support/popt.c
@@ -24,7 +24,7 @@ struct poptContext_s {
char ** leftovers;
int numLeftovers;
int nextLeftover;
- struct poptOption * options;
+ const struct poptOption * options;
int restLeftover;
char * appName;
struct poptAlias * aliases;
@@ -32,8 +32,20 @@ struct poptContext_s {
int flags;
};
+#ifndef HAVE_STRERROR
+static char * strerror(int errno) {
+ extern int sys_nerr;
+ extern char * sys_errlist[];
+
+ if ((0 <= errno) && (errno < sys_nerr))
+ return sys_errlist[errno];
+ else
+ return "unknown errno";
+}
+#endif
+
poptContext poptGetContext(char * name ,int argc, char ** argv,
- struct poptOption * options, int flags) {
+ const struct poptOption * options, int flags) {
poptContext con = malloc(sizeof(*con));
con->os = con->optionStack;
@@ -84,7 +96,7 @@ int poptGetNextOpt(poptContext con) {
char * origOptString;
long aLong;
char * end;
- struct poptOption * opt = NULL;
+ const struct poptOption * opt = NULL;
int done = 0;
int i;