I thought I'd piggyback an applet to this patch but since I'm not done
yet I'd better just send this one since it was asked for.

(Hmm, maybe I should be added as a maintainer.. )



Thomas.
Index: docs/new-applet-HOWTO.txt
===================================================================
--- docs/new-applet-HOWTO.txt	(revision 18530)
+++ docs/new-applet-HOWTO.txt	(working copy)
@@ -6,8 +6,11 @@
 Credits:
 Matt Kraai - initial writeup
 Mark Whitley - the remix
-Thomas Lundquist - Added stuff for the new directory layout.
+Thomas Lundquist - Trying to keep it updated.
 
+When doing this you should consider using the latest svn trunk.
+This is a good thing if you plan to getting it commited into mainline.
+
 Initial Write
 -------------
 
@@ -33,7 +36,7 @@
  */
 
 #include "busybox.h"
-#include <other.h>
+#include "other.h"
 
 int mu_main(int argc, char **argv);
 int mu_main(int argc, char **argv)
@@ -69,7 +72,35 @@
 Additionally, if you have any useful, general-purpose functions in your
 applet that could be useful in other applets, consider putting them in libbb.
 
+And it may be possible that some of the other applets uses functions you
+could use. If so, you have to rip the function out of the applet and make
+a libbb function out of it.
 
+Adding a libbb function:
+------------------------
+
+Make a new file named <function_name>.c
+
+----start example code------
+
+#include "libbb.h"
+#include "other.h"
+
+int function(char *a)
+{
+	return *a;
+}
+
+----end example code------
+
+Add <function_name>.o in the right alphabetically sorted place 
+in libbb/Kbuild. You should look at the conditional part of 
+libbb/Kbuild aswell.
+
+You can look at libbb/Config.in and try to find out if the function is 
+tuneable and add it there if it is.
+
+
 Placement / Directory
 ---------------------
 
@@ -78,9 +109,9 @@
 Make sure you find the appropriate places in the files, the applets are
 sorted alphabetically.
 
-Add the applet to Makefile.in in the chosen directory:
+Add the applet to Kbuild in the chosen directory:
 
-obj-$(CONFIG_MU)               += mu.o
+lib-$(CONFIG_MU)               += mu.o
 
 Add the applet to Config.in in the chosen directory:
 
@@ -119,31 +150,22 @@
 in alphabetical order, or else it will break the binary-search lookup
 algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily:
 
+Be sure to read the top of applets.h before adding your applet.
+
 	/* all programs above here are alphabetically "less than" 'mu' */
-	#ifdef CONFIG_MU
-		APPLET("mu", mu_main, _BB_DIR_USR_BIN, mu_usage)
-	#endif
+	USE_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 	/* all programs below here are alphabetically "greater than" 'mu' */
 
 
-Documentation
--------------
-
-If you're feeling especially nice, you should also document your applet in the
-docs directory (but nobody ever does that).
-
-Adding some text to docs/Configure.help is a nice start.
-
-
 The Grand Announcement
 ----------------------
 
-Then create a diff -urN of the files you added and/or modified. Typically:
-	<appletdir>/<applet>.c
-	include/usage.c
-	include/applets.h
-	<appletdir>/Makefile.in
-	<appletdir>/config.in
+Then create a diff by adding the new files with svn
+	svn add <where you put it>/mu.c
+eventually also: 
+	svn add libbb/function.c
+then
+	svn diff 
 and send it to the mailing list:
 	[email protected]
 	http://busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to