aboutsummaryrefslogtreecommitdiff
path: root/applets/applet_tables.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-02 01:10:32 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-02 01:10:32 +0200
commitacabf8fcb86302e55e01f0a20d5ff9914791416a (patch)
treeb1eff7768689d003f5c72a1ab175b1af52019012 /applets/applet_tables.c
parent3a7034c27b7fa8f3f08e2ace769f165f46afa0e3 (diff)
downloadbusybox-w32-acabf8fcb86302e55e01f0a20d5ff9914791416a.tar.gz
busybox-w32-acabf8fcb86302e55e01f0a20d5ff9914791416a.tar.bz2
busybox-w32-acabf8fcb86302e55e01f0a20d5ff9914791416a.zip
Update documentation generator so that it sucks less
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets/applet_tables.c')
-rw-r--r--applets/applet_tables.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c
index 17135ddc1..e67f017e7 100644
--- a/applets/applet_tables.c
+++ b/applets/applet_tables.c
@@ -70,29 +70,32 @@ int main(int argc, char **argv)
70 70
71 /* Keep in sync with include/busybox.h! */ 71 /* Keep in sync with include/busybox.h! */
72 72
73 puts("/* This is a generated file, don't edit */\n"); 73 printf("/* This is a generated file, don't edit */\n\n");
74 74
75 printf("#define NUM_APPLETS %u\n", NUM_APPLETS); 75 printf("#define NUM_APPLETS %u\n", NUM_APPLETS);
76 if (NUM_APPLETS == 1) { 76 if (NUM_APPLETS == 1) {
77 printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name); 77 printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name);
78 printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name); 78 printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name);
79 } 79 }
80 printf("\n");
80 81
81 puts("\nconst char applet_names[] ALIGN1 = \"\""); 82 printf("const char applet_names[] ALIGN1 = \"\"\n");
82 for (i = 0; i < NUM_APPLETS; i++) { 83 for (i = 0; i < NUM_APPLETS; i++) {
83 printf("\"%s\" \"\\0\"\n", applets[i].name); 84 printf("\"%s\" \"\\0\"\n", applets[i].name);
84 if (MAX_APPLET_NAME_LEN < strlen(applets[i].name)) 85 if (MAX_APPLET_NAME_LEN < strlen(applets[i].name))
85 MAX_APPLET_NAME_LEN = strlen(applets[i].name); 86 MAX_APPLET_NAME_LEN = strlen(applets[i].name);
86 } 87 }
87 puts(";"); 88 printf(";\n\n");
88 89
89 puts("\nint (*const applet_main[])(int argc, char **argv) = {"); 90 printf("#ifndef SKIP_applet_main\n");
91 printf("int (*const applet_main[])(int argc, char **argv) = {\n");
90 for (i = 0; i < NUM_APPLETS; i++) { 92 for (i = 0; i < NUM_APPLETS; i++) {
91 printf("%s_main,\n", applets[i].main); 93 printf("%s_main,\n", applets[i].main);
92 } 94 }
93 puts("};"); 95 printf("};\n");
96 printf("#endif\n\n");
94 97
95 puts("const uint16_t applet_nameofs[] ALIGN2 = {"); 98 printf("const uint16_t applet_nameofs[] ALIGN2 = {\n");
96 for (i = 0; i < NUM_APPLETS; i++) { 99 for (i = 0; i < NUM_APPLETS; i++) {
97 printf("0x%04x,\n", 100 printf("0x%04x,\n",
98 offset[i] 101 offset[i]
@@ -105,10 +108,10 @@ int main(int argc, char **argv)
105#endif 108#endif
106 ); 109 );
107 } 110 }
108 puts("};"); 111 printf("};\n\n");
109 112
110#if ENABLE_FEATURE_INSTALLER 113#if ENABLE_FEATURE_INSTALLER
111 puts("const uint8_t applet_install_loc[] ALIGN1 = {"); 114 printf("const uint8_t applet_install_loc[] ALIGN1 = {\n");
112 i = 0; 115 i = 0;
113 while (i < NUM_APPLETS) { 116 while (i < NUM_APPLETS) {
114 int v = applets[i].install_loc; /* 3 bits */ 117 int v = applets[i].install_loc; /* 3 bits */
@@ -117,7 +120,7 @@ int main(int argc, char **argv)
117 printf("0x%02x,\n", v); 120 printf("0x%02x,\n", v);
118 i++; 121 i++;
119 } 122 }
120 puts("};\n"); 123 printf("};\n\n");
121#endif 124#endif
122 125
123 printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); 126 printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN);