summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorMichael Johnson <johnsonm@src.gnome.org>1998-11-19 20:56:19 +0000
committerMichael Johnson <johnsonm@src.gnome.org>1998-11-19 20:56:19 +0000
commitd42980af516219af0bf42351f315dc534b804ff6 (patch)
tree9a359d081f109b3967332f448a0f86b0acf6246f /support
parent139ed9c81a4fbcb8a45aa7ed248b9831a02209cf (diff)
downloadshared-mime-info-d42980af516219af0bf42351f315dc534b804ff6.tar.gz
Improved man page a bit, install by default.
Added POPT_ARG_VAL svn path=/trunk/; revision=480
Diffstat (limited to 'support')
-rw-r--r--support/popt-gnome.h1
-rw-r--r--support/popt.c6
-rw-r--r--support/popt.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/support/popt-gnome.h b/support/popt-gnome.h
index e2160494..069cab11 100644
--- a/support/popt-gnome.h
+++ b/support/popt-gnome.h
@@ -22,6 +22,7 @@
for this table and any
included tables; arg points
to the domain string */
+#define POPT_ARG_VAL 7 /* arg should take value val */
#define POPT_ARG_MASK 0x0000FFFF
#define POPT_ARGFLAG_ONEDASH 0x80000000 /* allow -longoption */
#define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /* don't show in help/usage */
diff --git a/support/popt.c b/support/popt.c
index ca97e5de..f9e61538 100644
--- a/support/popt.c
+++ b/support/popt.c
@@ -392,6 +392,10 @@ int poptGetNextOpt(poptContext con) {
*((char **) opt->arg) = con->os->nextArg;
break;
+ case POPT_ARG_VAL:
+ *((int *) opt->arg) = opt->val;
+ break;
+
case POPT_ARG_INT:
case POPT_ARG_LONG:
aLong = strtol(con->os->nextArg, &end, 0);
@@ -419,7 +423,7 @@ int poptGetNextOpt(poptContext con) {
if (cb)
cb(con, POPT_CALLBACK_REASON_OPTION, opt, con->os->nextArg, cbData);
- else if (opt->val)
+ else if (opt->val && ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL))
done = 1;
if ((con->finalArgvCount + 2) >= (con->finalArgvAlloced)) {
diff --git a/support/popt.h b/support/popt.h
index e2160494..069cab11 100644
--- a/support/popt.h
+++ b/support/popt.h
@@ -22,6 +22,7 @@
for this table and any
included tables; arg points
to the domain string */
+#define POPT_ARG_VAL 7 /* arg should take value val */
#define POPT_ARG_MASK 0x0000FFFF
#define POPT_ARGFLAG_ONEDASH 0x80000000 /* allow -longoption */
#define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /* don't show in help/usage */