Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/applets/applet_tables.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1122 by niro, Sun May 30 11:32:42 2010 UTC revision 1123 by niro, Wed Aug 18 21:56:57 2010 UTC
# Line 79  int main(int argc, char **argv) Line 79  int main(int argc, char **argv)
79   }   }
80   printf("\n");   printf("\n");
81    
82   printf("#ifndef SKIP_definitions\n");   //printf("#ifndef SKIP_definitions\n");
83   printf("const char applet_names[] ALIGN1 = \"\"\n");   printf("const char applet_names[] ALIGN1 = \"\"\n");
84   for (i = 0; i < NUM_APPLETS; i++) {   for (i = 0; i < NUM_APPLETS; i++) {
85   printf("\"%s\" \"\\0\"\n", applets[i].name);   printf("\"%s\" \"\\0\"\n", applets[i].name);
# Line 123  int main(int argc, char **argv) Line 123  int main(int argc, char **argv)
123   }   }
124   printf("};\n");   printf("};\n");
125  #endif  #endif
126   printf("#endif /* SKIP_definitions */\n");   //printf("#endif /* SKIP_definitions */\n");
127   printf("\n");   printf("\n");
128   printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN);   printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN);
129    
130     if (argv[2]) {
131     char line_old[80];
132     char line_new[80];
133     FILE *fp;
134    
135     line_old[0] = 0;
136     fp = fopen(argv[2], "r");
137     if (fp) {
138     fgets(line_old, sizeof(line_old), fp);
139     fclose(fp);
140     }
141     sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS);
142     if (strcmp(line_old, line_new) != 0) {
143     fp = fopen(argv[2], "w");
144     if (!fp)
145     return 1;
146     fputs(line_new, fp);
147     }
148     }
149    
150   return 0;   return 0;
151  }  }

Legend:
Removed from v.1122  
changed lines
  Added in v.1123