diff options
Diffstat (limited to 'docs/new-applet-HOWTO.txt')
-rw-r--r-- | docs/new-applet-HOWTO.txt | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/docs/new-applet-HOWTO.txt b/docs/new-applet-HOWTO.txt index 2f237564d..bb29999cf 100644 --- a/docs/new-applet-HOWTO.txt +++ b/docs/new-applet-HOWTO.txt | |||
@@ -19,8 +19,7 @@ such as who you stole the code from and so forth. Also include the mini-GPL | |||
19 | boilerplate. Be sure to name the main function <applet>_main instead of main. | 19 | boilerplate. Be sure to name the main function <applet>_main instead of main. |
20 | And be sure to put it in <applet>.c. Usage does not have to be taken care of by | 20 | And be sure to put it in <applet>.c. Usage does not have to be taken care of by |
21 | your applet. | 21 | your applet. |
22 | Make sure to #include "libbb.h" as the first include file in your applet so | 22 | Make sure to #include "libbb.h" as the first include file in your applet. |
23 | the bb_config.h and appropriate platform specific files are included properly. | ||
24 | 23 | ||
25 | For a new applet mu, here is the code that would go in mu.c: | 24 | For a new applet mu, here is the code that would go in mu.c: |
26 | 25 | ||
@@ -99,14 +98,14 @@ int function(char *a) | |||
99 | ----end example code------ | 98 | ----end example code------ |
100 | 99 | ||
101 | Add <function_name>.o in the right alphabetically sorted place | 100 | Add <function_name>.o in the right alphabetically sorted place |
102 | in libbb/Kbuild. You should look at the conditional part of | 101 | in libbb/Kbuild.src. You should look at the conditional part of |
103 | libbb/Kbuild aswell. | 102 | libbb/Kbuild.src as well. |
104 | 103 | ||
105 | You should also try to find a suitable place in include/libbb.h for | 104 | You should also try to find a suitable place in include/libbb.h for |
106 | the function declaration. If not, add it somewhere anyway, with or without | 105 | the function declaration. If not, add it somewhere anyway, with or without |
107 | ifdefs to include or not. | 106 | ifdefs to include or not. |
108 | 107 | ||
109 | You can look at libbb/Config.in and try to find out if the function is | 108 | You can look at libbb/Config.src and try to find out if the function is |
110 | tunable and add it there if it is. | 109 | tunable and add it there if it is. |
111 | 110 | ||
112 | 111 | ||
@@ -118,11 +117,11 @@ Find the appropriate directory for your new applet. | |||
118 | Make sure you find the appropriate places in the files, the applets are | 117 | Make sure you find the appropriate places in the files, the applets are |
119 | sorted alphabetically. | 118 | sorted alphabetically. |
120 | 119 | ||
121 | Add the applet to Kbuild in the chosen directory: | 120 | Add the applet to Kbuild.src in the chosen directory: |
122 | 121 | ||
123 | lib-$(CONFIG_MU) += mu.o | 122 | lib-$(CONFIG_MU) += mu.o |
124 | 123 | ||
125 | Add the applet to Config.in in the chosen directory: | 124 | Add the applet to Config.src in the chosen directory: |
126 | 125 | ||
127 | config MU | 126 | config MU |
128 | bool "MU" | 127 | bool "MU" |
@@ -134,7 +133,7 @@ config MU | |||
134 | Usage String(s) | 133 | Usage String(s) |
135 | --------------- | 134 | --------------- |
136 | 135 | ||
137 | Next, add usage information for you applet to include/usage.h. | 136 | Next, add usage information for you applet to include/usage.src.h. |
138 | This should look like the following: | 137 | This should look like the following: |
139 | 138 | ||
140 | #define mu_trivial_usage \ | 139 | #define mu_trivial_usage \ |
@@ -149,17 +148,17 @@ This should look like the following: | |||
149 | If your program supports flags, the flags should be mentioned on the first | 148 | If your program supports flags, the flags should be mentioned on the first |
150 | line (-[abcde]) and a detailed description of each flag should go in the | 149 | line (-[abcde]) and a detailed description of each flag should go in the |
151 | mu_full_usage section, one flag per line. (Numerous examples of this | 150 | mu_full_usage section, one flag per line. (Numerous examples of this |
152 | currently exist in usage.h.) | 151 | currently exist in usage.src.h.) |
153 | 152 | ||
154 | 153 | ||
155 | Header Files | 154 | Header Files |
156 | ------------ | 155 | ------------ |
157 | 156 | ||
158 | Next, add an entry to include/applets.h. Be *sure* to keep the list | 157 | Next, add an entry to include/applets.src.h. Be *sure* to keep the list |
159 | in alphabetical order, or else it will break the binary-search lookup | 158 | in alphabetical order, or else it will break the binary-search lookup |
160 | algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily: | 159 | algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily: |
161 | 160 | ||
162 | Be sure to read the top of applets.h before adding your applet. | 161 | Be sure to read the top of applets.src.h before adding your applet. |
163 | 162 | ||
164 | /* all programs above here are alphabetically "less than" 'mu' */ | 163 | /* all programs above here are alphabetically "less than" 'mu' */ |
165 | IF_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_DROP)) | 164 | IF_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_DROP)) |