summaryrefslogtreecommitdiff
path: root/popt
diff options
context:
space:
mode:
Diffstat (limited to 'popt')
-rw-r--r--popt/po/popt.pot2
-rw-r--r--popt/po/ro.po2
-rw-r--r--popt/po/sk.po2
-rw-r--r--popt/popt.312
-rw-r--r--popt/popt.c12
-rw-r--r--popt/popt.h6
-rw-r--r--popt/test1.c2
-rw-r--r--popt/test2.c2
8 files changed, 20 insertions, 20 deletions
diff --git a/popt/po/popt.pot b/popt/po/popt.pot
index 6793fcf01..7e9bfbf9c 100644
--- a/popt/po/popt.pot
+++ b/popt/po/popt.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-10-25 16:06-0400\n"
+"POT-Creation-Date: 1999-10-26 13:07-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/popt/po/ro.po b/popt/po/ro.po
index f01b2de64..0f7b8050c 100644
--- a/popt/po/ro.po
+++ b/popt/po/ro.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: POPT\n"
-"POT-Creation-Date: 1999-10-22 17:29-0400\n"
+"POT-Creation-Date: 1999-10-26 13:07-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/popt/po/sk.po b/popt/po/sk.po
index 712b63e39..1f492eede 100644
--- a/popt/po/sk.po
+++ b/popt/po/sk.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt\n"
-"POT-Creation-Date: 1999-10-22 17:29-0400\n"
+"POT-Creation-Date: 1999-10-26 13:07-0400\n"
"PO-Revision-Date: 1999-08-04 21:40+0200\n"
"Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
diff --git a/popt/popt.3 b/popt/popt.3
index 96848d339..b07b39465 100644
--- a/popt/popt.3
+++ b/popt/popt.3
@@ -6,7 +6,7 @@ popt \- Parse command line options
.B #include <popt.h>
.sp
.BI "poptContext poptGetContext(const char * " name ", int " argc ,
-.BI " har ** "argv ,
+.BI " const char ** "argv ,
.BI " const struct poptOption * " options ,
.BI " int " flags );
.sp
@@ -16,9 +16,9 @@ popt \- Parse command line options
.sp
.BI "int poptGetNextOpt(poptContext " con );
.sp
-.BI "char * poptGetOptArg(poptContext " con );
+.BI "const char * poptGetOptArg(poptContext " con );
.sp
-.BI "char * poptGetArg(poptContext " con );
+.BI "const char * poptGetArg(poptContext " con );
.sp
.BI "const char * poptPeekArg(poptContext " con );
.sp
@@ -246,7 +246,7 @@ modified outside the popt library.
.sp
.nf
.BI "poptContext poptGetContext(const char * " name ", int "argc ",
-.BI " char ** "argv ",
+.BI " const char ** "argv ",
.BI " const struct poptOption * "options ",
.BI " int "flags ");"
.fi
@@ -333,7 +333,7 @@ ways to discover them. One is to ask popt to fill in a variable with the
.sp
.nf
.B #include <popt.h>
-.BI "char * poptGetOptArg(poptContext " con ");"
+.BI "const char * poptGetOptArg(poptContext " con ");"
.fi
.sp
This function returns the argument given for the final option returned by
@@ -347,7 +347,7 @@ of leftover arguments. Three functions allow applications to access such
arguments:
.nf
.HP
-.BI "char * poptGetArg(poptContext " con ");"
+.BI "const char * poptGetArg(poptContext " con ");"
.fi
This function returns the next leftover argument and marks it as
processed.
diff --git a/popt/popt.c b/popt/popt.c
index 3fb54f7db..75c8b9205 100644
--- a/popt/popt.c
+++ b/popt/popt.c
@@ -43,7 +43,7 @@ static void invokeCallbacks(poptContext con, const struct poptOption * table,
}
}
-poptContext poptGetContext(const char * name, int argc, char ** argv,
+poptContext poptGetContext(const char * name, int argc, const char ** argv,
const struct poptOption * options, int flags) {
poptContext con = malloc(sizeof(*con));
@@ -51,7 +51,7 @@ poptContext poptGetContext(const char * name, int argc, char ** argv,
con->os = con->optionStack;
con->os->argc = argc;
- con->os->argv = (const char **) argv; /* XXX don't change the API */
+ con->os->argv = argv;
con->os->argb = NULL;
if (!(flags & POPT_CONTEXT_KEEP_FIRST))
@@ -569,15 +569,15 @@ int poptGetNextOpt(poptContext con)
return opt->val;
}
-char * poptGetOptArg(poptContext con) {
- char * ret = (char *)con->os->nextArg; /* XXX don't change the API */
+const char * poptGetOptArg(poptContext con) {
+ const char * ret = con->os->nextArg;
con->os->nextArg = NULL;
return ret;
}
-char * poptGetArg(poptContext con) {
+const char * poptGetArg(poptContext con) {
if (con->numLeftovers == con->nextLeftover) return NULL;
- return (char *)con->leftovers[con->nextLeftover++]; /* XXX don't change the API */
+ return con->leftovers[con->nextLeftover++];
}
const char * poptPeekArg(poptContext con) {
diff --git a/popt/popt.h b/popt/popt.h
index b1e58faba..5046fade2 100644
--- a/popt/popt.h
+++ b/popt/popt.h
@@ -86,16 +86,16 @@ typedef void (*poptCallbackType)(poptContext con,
const char * arg, const void * data);
/*@only@*/ poptContext poptGetContext(/*@keep@*/ const char * name,
- int argc, /*@keep@*/ char ** argv,
+ int argc, /*@keep@*/ const char ** argv,
/*@keep@*/ const struct poptOption * options, int flags);
void poptResetContext(poptContext con);
/* returns 'val' element, -1 on last item, POPT_ERROR_* on error */
int poptGetNextOpt(poptContext con);
/* returns NULL if no argument is available */
-/*@observer@*/ /*@null@*/ char * poptGetOptArg(poptContext con);
+/*@observer@*/ /*@null@*/ const char * poptGetOptArg(poptContext con);
/* returns NULL if no more options are available */
-/*@observer@*/ /*@null@*/ char * poptGetArg(poptContext con);
+/*@observer@*/ /*@null@*/ const char * poptGetArg(poptContext con);
/*@observer@*/ /*@null@*/ const char * poptPeekArg(poptContext con);
/*@observer@*/ /*@null@*/ const char ** poptGetArgs(poptContext con);
/* returns the option which caused the most recent error */
diff --git a/popt/test1.c b/popt/test1.c
index 68ec7fdeb..416d59e8f 100644
--- a/popt/test1.c
+++ b/popt/test1.c
@@ -66,7 +66,7 @@ static void resetVars(void)
pass2 = 0;
}
-int main(int argc, char ** argv) {
+int main(int argc, const char ** argv) {
int rc;
int ec = 0;
poptContext optCon;
diff --git a/popt/test2.c b/popt/test2.c
index 5deb89d0d..f4e4baeec 100644
--- a/popt/test2.c
+++ b/popt/test2.c
@@ -46,7 +46,7 @@ char *fax = NULL;
int
-main(int argc, char**argv ) {
+main(int argc, const char ** argv) {
poptContext optCon; /* context for parsing command-line options */
struct poptOption userOptionsTable[] = {