diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-28 06:49:03 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-28 06:49:03 +0000 |
commit | 1aa7e477b1b727db77cac2d717f0fcca40587f78 (patch) | |
tree | 247171517f0e01d32a71a5e96f4bef462cc0e9c6 /include/libbb.h | |
parent | 79c6904faff1ebd4bf4b7d9cd0c20ca70f4cec75 (diff) | |
download | busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.tar.gz busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.tar.bz2 busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.zip |
reorganize applet table. Eliminates pointers to names.
Should be a big win for libbusybox. busybox wins too:
text data bss dec hex filename
776524 929 9100 786553 c0079 busybox_old
775903 929 9100 785932 bfe0c busybox_unstripped
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h index 095647dd4..2b928215f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -550,7 +550,6 @@ void clear_username_cache(void); | |||
550 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; | 550 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; |
551 | 551 | ||
552 | 552 | ||
553 | struct bb_applet; | ||
554 | int execable_file(const char *name); | 553 | int execable_file(const char *name); |
555 | char *find_execable(const char *filename); | 554 | char *find_execable(const char *filename); |
556 | int exists_execable(const char *filename); | 555 | int exists_execable(const char *filename); |
@@ -562,7 +561,7 @@ int exists_execable(const char *filename); | |||
562 | int bb_execvp(const char *file, char *const argv[]); | 561 | int bb_execvp(const char *file, char *const argv[]); |
563 | #define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) | 562 | #define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) |
564 | #define BB_EXECLP(prog,cmd,...) \ | 563 | #define BB_EXECLP(prog,cmd,...) \ |
565 | execlp((find_applet_by_name(prog)) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ | 564 | execlp((find_applet_by_name(prog) >= 0) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ |
566 | cmd, __VA_ARGS__) | 565 | cmd, __VA_ARGS__) |
567 | #else | 566 | #else |
568 | #define BB_EXECVP(prog,cmd) execvp(prog,cmd) | 567 | #define BB_EXECVP(prog,cmd) execvp(prog,cmd) |
@@ -600,8 +599,8 @@ struct nofork_save_area { | |||
600 | void save_nofork_data(struct nofork_save_area *save); | 599 | void save_nofork_data(struct nofork_save_area *save); |
601 | void restore_nofork_data(struct nofork_save_area *save); | 600 | void restore_nofork_data(struct nofork_save_area *save); |
602 | /* Does NOT check that applet is NOFORK, just blindly runs it */ | 601 | /* Does NOT check that applet is NOFORK, just blindly runs it */ |
603 | int run_nofork_applet(const struct bb_applet *a, char **argv); | 602 | int run_nofork_applet(int applet_no, char **argv); |
604 | int run_nofork_applet_prime(struct nofork_save_area *old, const struct bb_applet *a, char **argv); | 603 | int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv); |
605 | 604 | ||
606 | /* Helpers for daemonization. | 605 | /* Helpers for daemonization. |
607 | * | 606 | * |
@@ -786,10 +785,10 @@ const struct hwtype *get_hwntype(int type); | |||
786 | 785 | ||
787 | 786 | ||
788 | #ifndef BUILD_INDIVIDUAL | 787 | #ifndef BUILD_INDIVIDUAL |
789 | extern const struct bb_applet *find_applet_by_name(const char *name); | 788 | extern int find_applet_by_name(const char *name); |
790 | /* Returns only if applet is not found. */ | 789 | /* Returns only if applet is not found. */ |
791 | extern void run_applet_and_exit(const char *name, char **argv); | 790 | extern void run_applet_and_exit(const char *name, char **argv); |
792 | extern void run_appletstruct_and_exit(const struct bb_applet *a, char **argv) ATTRIBUTE_NORETURN; | 791 | extern void run_applet_no_and_exit(int a, char **argv) ATTRIBUTE_NORETURN; |
793 | #endif | 792 | #endif |
794 | 793 | ||
795 | extern int match_fstype(const struct mntent *mt, const char *fstypes); | 794 | extern int match_fstype(const struct mntent *mt, const char *fstypes); |