diff options
author | Guillem Jover <guillem@debian.org> | 2011-03-16 14:22:34 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-04-02 02:38:09 +0200 |
commit | ba372a8c554dfe6fa4f0e12961efab6b10aaf6bd (patch) | |
tree | 7b39cd5b13cb0139bbe2a3e2f4ea4fa66545cc42 /dpkg-deb/extract.c | |
parent | f6600ffa162e6f2f04f6a10d9622bee3bc8781a1 (diff) | |
download | dpkg-ba372a8c554dfe6fa4f0e12961efab6b10aaf6bd.tar.gz |
Make all command line action functions return int
This will allow using type-safe function pointers instead of casting
them around. Replace all exit(3) calls with return statements. Remove
DPKG_ATTR_NORET from function declarations, all functions are expected
to return now.
Diffstat (limited to 'dpkg-deb/extract.c')
-rw-r--r-- | dpkg-deb/extract.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index 24110e57a..970c62329 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -327,9 +327,10 @@ extracthalf(const char *debar, const char *dir, const char *taroption, } } -static void controlextractvextract(int admin, - const char *taroptions, - const char *const *argv) { +static int +controlextractvextract(int admin, const char *taroptions, + const char *const *argv) +{ const char *debar, *dir; if (!(debar= *argv++)) @@ -344,9 +345,13 @@ static void controlextractvextract(int admin, badusage(_("--%s takes at most two arguments (.deb and directory)"),cipaction->olong); } extracthalf(debar, dir, taroptions, admin); + + return 0; } -void do_fsystarfile(const char *const *argv) { +int +do_fsystarfile(const char *const *argv) +{ const char *debar; if (!(debar= *argv++)) @@ -354,8 +359,24 @@ void do_fsystarfile(const char *const *argv) { if (*argv) badusage(_("--%s takes only one argument (.deb filename)"),cipaction->olong); extracthalf(debar, NULL, NULL, 0); + + return 0; +} + +int +do_control(const char *const *argv) +{ + return controlextractvextract(1, "x", argv); +} + +int +do_extract(const char *const *argv) +{ + return controlextractvextract(0, "xp", argv); } -void do_control(const char *const *argv) { controlextractvextract(1, "x", argv); } -void do_extract(const char *const *argv) { controlextractvextract(0, "xp", argv); } -void do_vextract(const char *const *argv) { controlextractvextract(0, "xpv", argv); } +int +do_vextract(const char *const *argv) +{ + return controlextractvextract(0, "xpv", argv); +} |