diff options
| author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-06-24 12:36:54 +0000 |
|---|---|---|
| committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-06-24 12:36:54 +0000 |
| commit | 2e6d3cfa82eb64fffe53ccb5669aa7146228cf8f (patch) | |
| tree | 78fb21d71f9d8680422f85a00bc3045cd6185a99 /docs | |
| parent | 15576268971168108f289cac6d6ecc6fdbb5075e (diff) | |
| download | busybox-w32-2e6d3cfa82eb64fffe53ccb5669aa7146228cf8f.tar.gz busybox-w32-2e6d3cfa82eb64fffe53ccb5669aa7146228cf8f.tar.bz2 busybox-w32-2e6d3cfa82eb64fffe53ccb5669aa7146228cf8f.zip | |
Nore unarchive (and doc) fixes from Laurence Anderson
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/new-applet-HOWTO.txt | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/docs/new-applet-HOWTO.txt b/docs/new-applet-HOWTO.txt index 90e124d01..1f5c3ebd5 100644 --- a/docs/new-applet-HOWTO.txt +++ b/docs/new-applet-HOWTO.txt | |||
| @@ -70,40 +70,35 @@ you _write_ your applet) please read through the style guide in the docs | |||
| 70 | directory and make your program compliant. | 70 | directory and make your program compliant. |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | Some Words on utility.c | 73 | Some Words on libbb |
| 74 | ----------------------- | 74 | ------------------- |
| 75 | 75 | ||
| 76 | As you are writing your applet, please be aware of the body of pre-existing | 76 | As you are writing your applet, please be aware of the body of pre-existing |
| 77 | useful functions in utility.c. Use these instead of reinventing the wheel. | 77 | useful functions in libbb. Use these instead of reinventing the wheel. |
| 78 | |||
| 79 | If you use functions from utility.c, you may need to add to the preprocessor | ||
| 80 | conditionals in that file, to make sure the routines you need are included. | ||
| 81 | So, since your mu implementation used safe_read(), append "|| defined BB_MU" to | ||
| 82 | the #if instruction that precedes the safe_read() function in utility.c . | ||
| 83 | 78 | ||
| 84 | Additionally, if you have any useful, general-purpose functions in your | 79 | Additionally, if you have any useful, general-purpose functions in your |
| 85 | program that could be useful in another program, consider putting them in | 80 | program that could be useful in another program, consider putting them in |
| 86 | utility.c. | 81 | libbb. |
| 87 | 82 | ||
| 88 | 83 | ||
| 89 | Usage String(s) | 84 | Usage String(s) |
| 90 | --------------- | 85 | --------------- |
| 91 | 86 | ||
| 92 | Next, add usage information for you applet to usage.c. This should look like | 87 | Next, add usage information for you applet to usage.h. This should look like |
| 93 | the following: | 88 | the following: |
| 94 | 89 | ||
| 95 | #if defined BB_MU | 90 | #define mu_trivial_usage \ |
| 96 | const char mu_usage[] = | 91 | "-[abcde] FILES" |
| 97 | "mu\n" | 92 | #define mu_full_usage \ |
| 98 | #ifndef BB_FEATURE_TRIVIAL_HELP | 93 | "Returns an indeterminate value.\n\n" \ |
| 99 | "\nReturns an indeterminate value.\n" | 94 | "Options:\n" \ |
| 100 | #endif | 95 | "\t-a\t\tfirst function\n" \ |
| 101 | ; | 96 | "\t-b\t\tsecond function\n" \ |
| 102 | 97 | ||
| 103 | If your program supports flags, the flags should be mentioned on the first | 98 | If your program supports flags, the flags should be mentioned on the first |
| 104 | line (mu -[bcRovma]) and a detailed description of each flag should go in the | 99 | line (-[abcde]) and a detailed description of each flag should go in the |
| 105 | BB_FEATURE_TRIVIAL_HELP section, one flag per line. (Numerous examples of this | 100 | mu_full_usage section, one flag per line. (Numerous examples of this |
| 106 | currently exist in usage.c.) | 101 | currently exist in usage.h.) |
| 107 | 102 | ||
| 108 | 103 | ||
| 109 | Header Files | 104 | Header Files |
