summaryrefslogtreecommitdiff
path: root/test1.c
diff options
context:
space:
mode:
authorewt <ewt>1998-09-27 15:56:18 +0000
committerewt <ewt>1998-09-27 15:56:18 +0000
commitb211c63a4bcdae7cbb706d2d29bd4ce649765efd (patch)
tree6abfd192841c74b35dc05f9b12effd6789e16eff /test1.c
parent1368cd6128ccc5c7c7b3a03adb9045613acc6dd9 (diff)
downloadlibpopt-b211c63a4bcdae7cbb706d2d29bd4ce649765efd.tar.gz
1) modified test to display callback val field
2) split popt stuff into multiple iles
Diffstat (limited to 'test1.c')
-rw-r--r--test1.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test1.c b/test1.c
index a1559f0..9ad4a29 100644
--- a/test1.c
+++ b/test1.c
@@ -3,8 +3,9 @@
#include "popt.h"
-void option_callback(poptContext con, int key, char * arg, void * data) {
- printf("callback: %s %s ", (char *) data, arg);
+void option_callback(poptContext con, const struct poptOption * opt,
+ char * arg, void * data) {
+ printf("callback: %c %s %s ", opt->val, (char *) data, arg);
}
int main(int argc, char ** argv) {
@@ -19,8 +20,8 @@ int main(int argc, char ** argv) {
int usage = 0;
struct poptOption callbackArgs[] = {
{ NULL, '\0', POPT_ARG_CALLBACK, option_callback, 0, "sampledata" },
- { "cb", 'c', POPT_ARG_STRING, NULL, 0, "Test argument callbacks" },
- { "long", '\0', 0, NULL, 0, "Unused option for help testing" },
+ { "cb", 'c', POPT_ARG_STRING, NULL, 'c', "Test argument callbacks" },
+ { "long", '\0', 0, NULL, 'l', "Unused option for help testing" },
{ NULL, '\0', 0, NULL, 0 }
};
struct poptOption moreArgs[] = {