OSDN Git Service

Missing comma, and slight simplification in defconfig sed invocation.
[android-x86/external-toybox.git] / scripts / install.c
1 /* vi: set ts=4 :*/
2 /* Wrapper to make installation easier with cross-compiling.
3  *
4  * Copyright 2006 Rob Landley <rob@landley.net>
5  */
6
7 #include "toys.h"
8
9 #undef NEWTOY
10 #undef OLDTOY
11 #define NEWTOY(name, opts, flags) {#name, 0, opts, flags},
12 #define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags},
13
14 // Populate toy_list[].
15
16 struct toy_list toy_list[] = {
17 #include "toys/toylist.h"
18 };
19
20 #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list))
21
22 int main(int argc, char *argv[])
23 {
24         static char *toy_paths[]={"usr/","bin/","sbin/",0};
25         int i, len = 0;
26
27         // Output list of applets.
28         for (i=1; i<TOY_LIST_LEN; i++) {
29                 int fl = toy_list[i].flags;
30                 if (fl & TOYMASK_LOCATION) {
31                         if (argc>1) {
32                                 int j;
33                                 for (j=0; toy_paths[j]; j++)
34                                         if (fl & (1<<j)) len += printf("%s", toy_paths[j]);
35                         }
36                         len += printf("%s\n",toy_list[i].name);
37                 }
38         }
39         return 0;
40 }