aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.h10
-rw-r--r--include/busybox.h14
-rw-r--r--include/libbb.h19
-rw-r--r--include/platform.h5
4 files changed, 34 insertions, 14 deletions
diff --git a/include/applets.h b/include/applets.h
index ac3f65f6d..ceab00334 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -24,11 +24,11 @@ s - suid type:
24*/ 24*/
25 25
26#if defined(PROTOTYPES) 26#if defined(PROTOTYPES)
27# define APPLET(name,l,s) int name##_main(int argc, char **argv); 27# define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
28# define APPLET_NOUSAGE(name,main,l,s) int main##_main(int argc, char **argv); 28# define APPLET_NOUSAGE(name,main,l,s) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29# define APPLET_ODDNAME(name,main,l,s,name2) int main##_main(int argc, char **argv); 29# define APPLET_ODDNAME(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30# define APPLET_NOEXEC(name,main,l,s,name2) int main##_main(int argc, char **argv); 30# define APPLET_NOEXEC(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
31# define APPLET_NOFORK(name,main,l,s,name2) int main##_main(int argc, char **argv); 31# define APPLET_NOFORK(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
32 32
33#elif defined(NAME_MAIN_CNAME) 33#elif defined(NAME_MAIN_CNAME)
34# define APPLET(name,l,s) name name##_main name 34# define APPLET(name,l,s) name name##_main name
diff --git a/include/busybox.h b/include/busybox.h
index 1c23b9bb0..5c01eca8d 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -48,12 +48,22 @@ struct bb_applet {
48#endif 48#endif
49}; 49};
50 50
51
51/* Defined in appletlib.c */ 52/* Defined in appletlib.c */
52extern const struct bb_applet applets[]; 53extern const struct bb_applet applets[];
53extern const unsigned short NUM_APPLETS; 54extern const unsigned short NUM_APPLETS;
54void bbox_prepare_main(char **argv); 55
56/* Length of these names has effect on size of libbusybox
57 * and "individual" binaries. Keep them short.
58 */
59void lbb_prepare(char **argv) MAIN_EXTERNALLY_VISIBLE;
55#if ENABLE_BUILD_LIBBUSYBOX 60#if ENABLE_BUILD_LIBBUSYBOX
56int libbusybox_main(int argc, char **argv); 61#if ENABLE_FEATURE_SHARED_BUSYBOX
62int lbb_main(int argc, char **argv) EXTERNALLY_VISIBLE;
63#else
64int lbb_main(int argc, char **argv);
57#endif 65#endif
66#endif
67
58 68
59#endif /* _BB_INTERNAL_H_ */ 69#endif /* _BB_INTERNAL_H_ */
diff --git a/include/libbb.h b/include/libbb.h
index 9d8b5f3df..be548a306 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -673,7 +673,7 @@ extern int die_sleep;
673extern int xfunc_error_retval; 673extern int xfunc_error_retval;
674extern jmp_buf die_jmp; 674extern jmp_buf die_jmp;
675extern void xfunc_die(void) ATTRIBUTE_NORETURN; 675extern void xfunc_die(void) ATTRIBUTE_NORETURN;
676extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE; 676extern void bb_show_usage(void) ATTRIBUTE_NORETURN;
677extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 677extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
678extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 678extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
679extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 679extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
@@ -687,18 +687,27 @@ extern void bb_perror_nomsg(void);
687extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 687extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
688extern void bb_verror_msg(const char *s, va_list p, const char *strerr); 688extern void bb_verror_msg(const char *s, va_list p, const char *strerr);
689 689
690/* We need to export XXX_main from libbusybox
691 * only if we build "individual" binaries
692 */
693#if ENABLE_FEATURE_INDIVIDUAL
694#define MAIN_EXTERNALLY_VISIBLE EXTERNALLY_VISIBLE
695#else
696#define MAIN_EXTERNALLY_VISIBLE
697#endif
698
690 699
691/* applets which are useful from another applets */ 700/* applets which are useful from another applets */
692int bb_cat(char** argv); 701int bb_cat(char** argv);
693int bb_echo(char** argv); 702int bb_echo(char** argv);
694int test_main(int argc, char** argv); 703int test_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
695int kill_main(int argc, char **argv); 704int kill_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
696#if ENABLE_ROUTE 705#if ENABLE_ROUTE
697void bb_displayroutes(int noresolve, int netstatfmt); 706void bb_displayroutes(int noresolve, int netstatfmt);
698#endif 707#endif
699int chown_main(int argc, char **argv); 708int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
700#if ENABLE_GUNZIP 709#if ENABLE_GUNZIP
701int gunzip_main(int argc, char **argv); 710int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
702#endif 711#endif
703int bbunpack(char **argv, 712int bbunpack(char **argv,
704 char* (*make_new_name)(char *filename), 713 char* (*make_new_name)(char *filename),
diff --git a/include/platform.h b/include/platform.h
index 39809450e..53d72829f 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -71,9 +71,10 @@
71/* -fwhole-program makes all symbols local. The attribute externally_visible 71/* -fwhole-program makes all symbols local. The attribute externally_visible
72 forces a symbol global. */ 72 forces a symbol global. */
73# if __GNUC_PREREQ (4,1) 73# if __GNUC_PREREQ (4,1)
74# define ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((__externally_visible__)) 74# define EXTERNALLY_VISIBLE __attribute__(( visibility("default") ));
75//__attribute__ ((__externally_visible__))
75# else 76# else
76# define ATTRIBUTE_EXTERNALLY_VISIBLE 77# define EXTERNALLY_VISIBLE
77# endif /* GNUC >= 4.1 */ 78# endif /* GNUC >= 4.1 */
78 79
79/* We use __extension__ in some places to suppress -pedantic warnings 80/* We use __extension__ in some places to suppress -pedantic warnings