Mercurial > hg > toybox
view scripts/install.c @ 1008:a55854bde872
su: cleanery
* make help message more like others
* s/TT\.(.)Argu/TT.\1/g
* move environ to toys.h
* simplify failure messages
* clear password before quit
* not check what execve returns
* -lc
author | Strake <strake888@gmail.com> |
---|---|
date | Sat, 17 Aug 2013 02:54:58 -0500 |
parents | 786841fdb1e0 |
children | 5f8fe22a33b8 |
line wrap: on
line source
/* Wrapper to make installation easier with cross-compiling. * * Copyright 2006 Rob Landley <rob@landley.net> */ #include "toys.h" #undef NEWTOY #undef OLDTOY #define NEWTOY(name, opts, flags) {#name, 0, opts, flags}, #define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags}, // Populate toy_list[]. struct toy_list toy_list[] = { #include "generated/newtoys.h" }; #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list)) int main(int argc, char *argv[]) { static char *toy_paths[]={"usr/","bin/","sbin/",0}; int i, len = 0; // Output list of applets. for (i=1; i<TOY_LIST_LEN; i++) { int fl = toy_list[i].flags; if (fl & TOYMASK_LOCATION) { if (argc>1) { int j; for (j=0; toy_paths[j]; j++) if (fl & (1<<j)) len += printf("%s", toy_paths[j]); } len += printf("%s\n",toy_list[i].name); } } return 0; }