Mercurial > hg > toybox
annotate scripts/install.c @ 1387:a0d26c5e3271 draft
Release notes for 0.4.9.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 07 Jul 2014 07:32:56 -0500 |
parents | 786841fdb1e0 |
children | 5f8fe22a33b8 |
rev | line source |
---|---|
89 | 1 /* Wrapper to make installation easier with cross-compiling. |
2 * | |
3 * Copyright 2006 Rob Landley <rob@landley.net> | |
4 */ | |
5 | |
6 #include "toys.h" | |
7 | |
8 #undef NEWTOY | |
9 #undef OLDTOY | |
10 #define NEWTOY(name, opts, flags) {#name, 0, opts, flags}, | |
91
b596b9b3b2af
Missing comma, and slight simplification in defconfig sed invocation.
Rob Landley <rob@landley.net>
parents:
89
diff
changeset
|
11 #define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags}, |
89 | 12 |
13 // Populate toy_list[]. | |
14 | |
15 struct toy_list toy_list[] = { | |
237
7cb15eae1664
Zap toylist.h, moving contents of global structures into DEFINE_GLOBALS()
Rob Landley <rob@landley.net>
parents:
91
diff
changeset
|
16 #include "generated/newtoys.h" |
89 | 17 }; |
18 | |
19 #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list)) | |
20 | |
21 int main(int argc, char *argv[]) | |
22 { | |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
23 static char *toy_paths[]={"usr/","bin/","sbin/",0}; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
24 int i, len = 0; |
89 | 25 |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
26 // Output list of applets. |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
27 for (i=1; i<TOY_LIST_LEN; i++) { |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
28 int fl = toy_list[i].flags; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
29 if (fl & TOYMASK_LOCATION) { |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
30 if (argc>1) { |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
31 int j; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
32 for (j=0; toy_paths[j]; j++) |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
33 if (fl & (1<<j)) len += printf("%s", toy_paths[j]); |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
34 } |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
35 len += printf("%s\n",toy_list[i].name); |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
36 } |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
37 } |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
237
diff
changeset
|
38 return 0; |
89 | 39 } |