diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
commit | 9634760d5eae4e8618e4b9ed9752d7305b3695a9 (patch) | |
tree | fc717bec9a623d6e80f2c4544cec14b8b8eb07da /Src/Modules/cap.c | |
parent | 043c302261dfee52e54e9a6c42b4ebcc2f7ccd33 (diff) | |
download | zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.gz zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.xz zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.zip |
17582: Improved option argument handling.
unposted: Updated version to 4.1.0-dev-6 because of interface change.
Diffstat (limited to 'Src/Modules/cap.c')
-rw-r--r-- | Src/Modules/cap.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/Src/Modules/cap.c b/Src/Modules/cap.c index 008b6932d..ba377f876 100644 --- a/Src/Modules/cap.c +++ b/Src/Modules/cap.c @@ -33,7 +33,7 @@ #ifdef HAVE_CAP_GET_PROC static int -bin_cap(char *nam, char **argv, char *ops, int func) +bin_cap(char *nam, char **argv, Options ops, int func) { int ret = 0; cap_t caps; @@ -48,7 +48,7 @@ bin_cap(char *nam, char **argv, char *ops, int func) ret = 1; } } else { - char *result; + char *result = NULL; ssize_t length; caps = cap_get_proc(); if(caps) @@ -59,17 +59,17 @@ bin_cap(char *nam, char **argv, char *ops, int func) } else puts(result); } - cap_free(&caps); + cap_free(caps); return ret; } static int -bin_getcap(char *nam, char **argv, char *ops, int func) +bin_getcap(char *nam, char **argv, Options ops, int func) { int ret = 0; do { - char *result; + char *result = NULL; ssize_t length; cap_t caps = cap_get_file(*argv); if(caps) @@ -79,13 +79,13 @@ bin_getcap(char *nam, char **argv, char *ops, int func) ret = 1; } else printf("%s %s\n", *argv, result); - cap_free(&caps); + cap_free(caps); } while(*++argv); return ret; } static int -bin_setcap(char *nam, char **argv, char *ops, int func) +bin_setcap(char *nam, char **argv, Options ops, int func) { cap_t caps; int ret = 0; @@ -102,7 +102,7 @@ bin_setcap(char *nam, char **argv, char *ops, int func) ret = 1; } } while(*++argv); - cap_free(&caps); + cap_free(caps); return ret; } @@ -124,18 +124,29 @@ static struct builtin bintab[] = { /**/ int -boot_cap(Module m) +setup_(Module m) { - return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); + return 0; } -#ifdef MODULE +/**/ +int +boot_(Module m) +{ + return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); +} /**/ int -cleanup_cap(Module m) +cleanup_(Module m) { deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); return 0; } -#endif + +/**/ +int +finish_(Module m) +{ + return 0; +} |