/external/toybox/toys/other/ |
netcat.c | 54 #include "toys.h" 104 if ((toys.optflags&FLAG_f) ? toys.optc : 105 (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2)) 130 if (!CFG_NETCAT_LISTEN || !(toys.optflags&(FLAG_L|FLAG_l))) { 132 lookup_name(*toys.optargs, (uint32_t *)&address.sin_addr); 133 lookup_port(toys.optargs[1], &address.sin_port); 151 if ((toys.optflags & FLAG_l) && toys.optc) [all...] |
blockdev.c | 32 #include "toys.h" 46 if (!toys.optflags) help_exit("need --option"); 48 for (ss = toys.optargs; *ss; ss++) { 53 long flag = toys.optflags & (1<<i); 63 if (!flag) printf("%lld\n", (toys.optflags & FLAG_getsz) ? val >> 9: val);
|
fallocate.c | 20 #include "toys.h" 28 int fd = xcreate(*toys.optargs, O_RDWR | O_CREAT, 0644);
|
inotifyd.c | 34 #include "toys.h" 40 char *prog_args[5], **ss = toys.optargs; 45 *prog_args = *toys.optargs; 50 toys.optc--; 67 // is the toys.optargs position of the file. (0 is program to run.) 102 toys.optargs[event->wd], event->name); 105 prog_args[2] = toys.optargs[event->wd]; 111 if (--toys.optc <= 0) { 125 toys.exitval = !!toys.signal [all...] |
pmap.c | 23 #include "toys.h" 29 for (optargs = toys.optargs; *optargs; optargs++) { 33 *k = (toys.optflags & FLAG_x) ? "" : "K"; 48 (toys.optflags & FLAG_x) ? "s" : ""); 54 if ((toys.optflags & (FLAG_q|FLAG_x)) == FLAG_x) 72 6+!!(toys.optflags & FLAG_x), end, k); 73 if (toys.optflags & FLAG_x) { 99 if (!(toys.optflags & FLAG_q)) { 100 int x = !!(toys.optflags & FLAG_x);
|
shred.c | 30 #include "toys.h" 44 if (!(toys.optflags & FLAG_n)) TT.iterations++; 50 for (try = toys.optargs; *try; try++) { 55 if (fd == -1 && (toys.optflags & FLAG_f)) { 78 if (++iter == TT.iterations && (toys.optargs && FLAG_z)) { 96 if (toys.optflags & FLAG_x) 103 if (toys.optflags & FLAG_u)
|
mkpasswd.c | 24 #include "toys.h" 38 if (toys.optc == 2) { 40 TT.salt = toys.optargs[1]; 61 if (!*toys.optargs) { 76 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt));
|
losetup.c | 35 #include "toys.h" 65 unsigned flags = toys.optflags; 154 TT.openflags = (toys.optflags & FLAG_r) ? O_RDONLY : O_RDWR; 173 if (toys.optflags & FLAG_f) { 174 if (toys.optc > 1) perror_exit("max 1 arg"); 175 loopback_setup(NULL, *toys.optargs); 176 } else if (toys.optflags & (FLAG_a|FLAG_j)) { 177 if (toys.optc) error_exit("bad args"); 181 char *file = (toys.optflags & (FLAG_d|FLAG_c)) ? NULL : toys.optargs[1] [all...] |
/external/toybox/toys/android/ |
setenforce.c | 18 #include "toys.h" 22 char *new = *toys.optargs;
|
getprop.c | 18 #include "toys.h" 49 if (toys.optflags & FLAG_Z) { 69 if (toys.optflags & FLAG_Z) { 78 if (*toys.optargs) { 79 if (toys.optflags & FLAG_Z) { 80 char *context = get_property_context(*toys.optargs); 85 property_get(*toys.optargs, toybuf, toys.optargs[1] ? toys.optargs[1] : ""); 102 if (CFG_TOYBOX_FREE && (toys.optflags & FLAG_Z)) selabel_close(TT.handle) [all...] |
/external/toybox/toys/lsb/ |
hostname.c | 19 #include "toys.h" 23 const char *hostname = toys.optargs[0];
|
passwd.c | 36 #include "toys.h" 114 if (myuid && (toys.optflags & (FLAG_l | FLAG_u | FLAG_d))) 119 if (*toys.optargs) name = toys.optargs[0]; 134 if (!(toys.optflags & (FLAG_l | FLAG_u | FLAG_d))) { 136 if (!(toys.optflags & FLAG_a)) TT.algo = "des"; 147 if (!toys.optargs[0]) free(name); 160 if (!toys.optargs[0]) free(name); 167 } else if (toys.optflags & FLAG_l) { 171 } else if (toys.optflags & FLAG_u) [all...] |
/external/toybox/toys/posix/ |
head.c | 22 #include "toys.h" 33 if (toys.optc > 1) { 53 char *arg = *toys.optargs; 58 toys.optc--; 60 loopfiles(toys.optargs+!!arg, do_head);
|
id.c | 64 #include "toys.h" 72 if (toys.optflags&FLAG_n) printf("%s", s); 93 flags = toys.optflags; 105 if (toys.optflags&FLAG_u) s_or_u(pw->pw_name, pw->pw_uid, 1); 110 if (!(toys.optflags&(FLAG_g|FLAG_Z))) { 128 if (!(toys.optflags&FLAG_Z)) { 135 int show_separator = !(toys.optflags&FLAG_G); 137 if (show_separator) xputc((toys.optflags&FLAG_G) ? ' ' : ','); 140 else if (toys.optflags&FLAG_G) s_or_u(grp->gr_name, grp->gr_gid, 0); 144 if (toys.optflags&FLAG_G) [all...] |
tee.c | 23 #include "toys.h" 48 if (toys.optflags & FLAG_i) xsignal(SIGINT, SIG_IGN); 51 loopfiles_rw(toys.optargs, 52 O_RDWR|O_CREAT|((toys.optflags & FLAG_a)?O_APPEND:O_TRUNC), 66 if(len != writeall(fdl ? fdl->fd : 1, toybuf, len)) toys.exitval=1;
|
rm.c | 23 #include "toys.h" 27 int fd = dirtree_parentfd(try), flags = toys.optflags; 54 if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700); 85 if (!toys.optc && !(toys.optflags & FLAG_f)) error_exit("Needs 1 argument"); 87 for (s = toys.optargs; *s; s++) { 95 if ((toys.optflags & FLAG_f) && (!unlink(*s) || errno == ENOENT))
|
uniq.c | 28 #include "toys.h" 55 if (toys.optflags & (TT.repeats ? FLAG_u : FLAG_d)) return; 56 if (toys.optflags & FLAG_c) fprintf(f, "%7lu ", TT.repeats + 1); 58 if (toys.optflags & FLAG_z) fputc(0, f); 67 if (toys.optc >= 1) infile = xfopen(toys.optargs[0], "r"); 68 if (toys.optc >= 2) outfile = xfopen(toys.optargs[1], "w"); 70 if (toys.optflags & FLAG_z) eol = 0; 90 diff = !(toys.optflags & FLAG_i) ? strcmp(t1, t2) : strcasecmp(t1, t2) [all...] |
echo.c | 34 #include "toys.h" 42 arg = toys.optargs[i]; 48 if (!(toys.optflags & FLAG_e)) { 87 if (!(toys.optflags&FLAG_n)) putchar('\n');
|
strings.c | 26 #include "toys.h" 48 if (toys.optflags & FLAG_f) printf("%s: ", filename); 49 if (toys.optflags & FLAG_o) 66 loopfiles(toys.optargs, do_strings);
|
/external/toybox/toys/pending/ |
ipcrm.c | 23 #include "toys.h" 71 ++toys.argv; 72 if (toys.optc && (!strcmp(*toys.argv, "shm") || 73 !strcmp(*toys.argv, "sem") || !strcmp(*toys.argv, "msg"))) { 74 int t = (toys.argv[0][1] == 'h')? 1 : (toys.argv[0][1] == 's')? 2:3; 76 while (*(++toys.argv)) do_ipcrm(0, t, *toys.argv); [all...] |
watch.c | 21 #include "toys.h" 32 char *header, *cmd = *toys.optargs; 35 while(toys.optargs[++i]) 38 cmd = xmprintf("%s %s", oldcmd, toys.optargs[i]); 46 if(!(toys.optflags & FLAG_t)) { 58 if ((toys.optflags & FLAG_e) && retval){ 68 if (cmd != *toys.optargs) free(cmd);
|
arp.c | 35 #include "toys.h" 146 resolve_host(toys.optargs[0], &sa); 162 if (!toys.optargs[1]) error_exit("bad syntax"); 164 if (!(toys.optflags & FLAG_D)) get_hw_add(toys.optargs[1], (char*)&req.arp_ha.sa_data); 168 xstrncpy(ifre.ifr_name, toys.optargs[1], IFNAMSIZ); 170 if ((toys.optflags & FLAG_H) && (ifre.ifr_hwaddr.sa_family != ARPHRD_ETHER)) 176 if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2)); 181 if (toys.optflags & FLAG_v) xprintf("Entry set for %s\n", toys.optargs[0]) [all...] |
ping.c | 33 #include "toys.h" 59 if(!(toys.optflags & (FLAG_4|FLAG_6))) { 61 if (inet_pton(AF_INET6, toys.optargs[0], (void*)&src_addr)) 62 toys.optflags |= FLAG_6; 65 if (toys.optflags & FLAG_6) { 73 if (!(toys.optflags & FLAG_s)) TT.size = 56; // 64-PHDR_LEN
|
arping.c | 31 #include "toys.h" 85 if (!(toys.optflags & FLAG_q)) { 90 if (toys.optflags & FLAG_D) exit(!!TT.rcvd_nr); 92 if (toys.optflags & FLAG_U) exit(EXIT_SUCCESS); 108 arp_h->ar_op = (toys.optflags & FLAG_A) ? htons(ARPOP_REPLY) 114 (toys.optflags & FLAG_A) ? &src_pk.sll_addr : &dst_pk.sll_addr, 152 if (toys.optflags & FLAG_D) { 157 if (!(toys.optflags & FLAG_q)) { 175 if (toys.optflags & FLAG_f) done(0); 176 if (!(toys.optflags & FLAG_b)) [all...] |
more.c | 19 #include "toys.h" 67 if (toys.optc > 1) show_file_header(name); 80 loopfiles(toys.optargs, do_cat_operation); 98 if (*toys.optargs && !(fp = fopen(*toys.optargs, "r"))) { 99 perror_msg("%s", *toys.optargs); 107 if (toys.optc > 1) { 108 show_file_header(*toys.optargs); 138 if (*toys.optargs && *++toys.optargs) [all...] |