diff options
author | ewt <devnull@localhost> | 1998-09-27 15:56:18 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1998-09-27 15:56:18 +0000 |
commit | 41bcd2e98b4fb80e0ad5569aab9da8b16bb4391f (patch) | |
tree | 6a55bf1caf0168f1082319fc5fde6862c8a1c1dc /popt/test1.c | |
parent | aacc8cc6c9f48decef167358fca1f840e8304294 (diff) | |
download | librpm-tizen-41bcd2e98b4fb80e0ad5569aab9da8b16bb4391f.tar.gz librpm-tizen-41bcd2e98b4fb80e0ad5569aab9da8b16bb4391f.tar.bz2 librpm-tizen-41bcd2e98b4fb80e0ad5569aab9da8b16bb4391f.zip |
1) modified test to display callback val field
2) split popt stuff into multiple iles
CVS patchset: 2361
CVS date: 1998/09/27 15:56:18
Diffstat (limited to 'popt/test1.c')
-rw-r--r-- | popt/test1.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/popt/test1.c b/popt/test1.c index a1559f059..9ad4a296e 100644 --- a/popt/test1.c +++ b/popt/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[] = { |