/external/toybox/toys/pending/ |
D | test.c | 49 if (!strcmp("]", toys.optargs[--toys.optc])) error_exit("Missing ']'"); in test_main() 50 if (!strcmp("!", toys.optargs[0])) { in test_main() 52 toys.optargs++; in test_main() 56 else if (toys.optargs[0][0] == '-') { in test_main() 57 id = stridx("bcdefghLpSsurwxznt", toys.optargs[0][1]); in test_main() 58 if (id == -1 || toys.optargs[0][2]) error_exit(err_fmt, toys.optargs[0]); in test_main() 64 if (lstat(toys.optargs[1], &st) == -1) return; in test_main() 66 if (!nolink && (stat(toys.optargs[1], &st) == -1)) return; in test_main() 81 toys.exitval = access(toys.optargs[1], 1 << (id - 12)) == -1; in test_main() 83 toys.exitval = toys.optargs[1] && !*toys.optargs[1] ^ (id - 15); in test_main() [all …]
|
D | groupadd.c | 52 entry = xmprintf("%s:%s:%d:", *toys.optargs, "x", TT.gid); 53 update_password(GROUP_PATH, *toys.optargs, entry); 55 entry = xmprintf("%s:%s::", *toys.optargs, "!"); 56 update_password(SECURE_GROUP_PATH, *toys.optargs, entry); 70 xgetpwnam(*toys.optargs); in groupadd_main() 71 if (!(grp = getgrnam(toys.optargs[1]))) in groupadd_main() 72 error_exit("group '%s' does not exist", toys.optargs[1]); in groupadd_main() 73 if (!grp->gr_mem) entry = xmprintf("%s", *toys.optargs); in groupadd_main() 78 if (!strcmp(grp->gr_mem[i], *toys.optargs)) return; in groupadd_main() 86 entry = xrealloc(entry, strlen(entry) + strlen(*toys.optargs) + 1); in groupadd_main() [all …]
|
D | more.c | 80 loopfiles(toys.optargs, do_cat_operation); in more_main() 98 if (*toys.optargs && !(fp = fopen(*toys.optargs, "r"))) { in more_main() 99 perror_msg("%s", *toys.optargs); in more_main() 108 show_file_header(*toys.optargs); in more_main() 138 if (*toys.optargs && *++toys.optargs) { in more_main() 139 input_key = prompt(cin, "--More--(Next file: %s)", *toys.optargs); in more_main() 142 } while (*toys.optargs); in more_main()
|
D | arp.c | 146 resolve_host(toys.optargs[0], &sa); in check_flags() 162 if (!toys.optargs[1]) error_exit("bad syntax"); in set_entry() 164 if (!(toys.optflags & FLAG_D)) get_hw_add(toys.optargs[1], (char*)&req.arp_ha.sa_data); in set_entry() 168 xstrncpy(ifre.ifr_name, toys.optargs[1], IFNAMSIZ); in set_entry() 176 if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2)); in set_entry() 181 if (toys.optflags & FLAG_v) xprintf("Entry set for %s\n", toys.optargs[0]); in set_entry() 205 if (toys.optargs[1]) check_flags(&flags, (toys.optargs+1)); in delete_entry() 210 if (toys.optflags & FLAG_v) xprintf("Delete entry for %s\n", toys.optargs[0]); in delete_entry() 239 if (!toys.optargs[0]) error_exit("host name req"); in arp_main() 240 resolve_host(toys.optargs[0], &sa); in arp_main() [all …]
|
D | groupdel.c | 25 struct group *grp = xgetgrnam(toys.optargs[toys.optc-1]); in groupdel_main() 33 xgetpwnam(*toys.optargs); in groupdel_main() 35 if (!found && !strcmp(*toys.optargs, grp->gr_mem[i])) found++; in groupdel_main() 39 error_exit("user '%s' not in group '%s'", *toys.optargs, toys.optargs[1]); in groupdel_main()
|
D | sh.c | 305 if (toys.optargs != toys.argv+1) free(toys.optargs); in run_pipeline() 356 char *dest = *toys.optargs ? *toys.optargs : getenv("HOME"); in cd_main() 363 exit(*toys.optargs ? atoi(*toys.optargs) : 0); in exit_main() 373 f = *toys.optargs ? xfopen(*toys.optargs, "r") : NULL; in sh_main()
|
D | watch.c | 32 char *header, *cmd = *toys.optargs; 35 while(toys.optargs[++i]) 38 cmd = xmprintf("%s %s", oldcmd, toys.optargs[i]); 68 if (cmd != *toys.optargs) free(cmd);
|
D | useradd.c | 44 char *s = *toys.optargs, *entry; 50 xexec((char *[]){"groupadd", toys.optargs[0], toys.optargs[1], 0}); 67 pwd.pw_dir = TT.dir ? TT.dir : xmprintf("/home/%s", *toys.optargs); 107 if (xrun((char *[]){"groupadd", *toys.optargs, s, 0})) 155 if (xrun((char *[]){"groupadd", *toys.optargs, TT.u_grp, 0}))
|
D | logger.c | 58 for (;*toys.optargs; toys.optargs++) { in logger_main() 59 length += strlen(*(toys.optargs)) + 1; // plus one for the args spacing in logger_main() 62 sprintf(message + pos, "%s ", *toys.optargs); in logger_main()
|
/external/toybox/toys/other/ |
D | vconfig.c | 40 cmd = toys.optargs[0]; in vconfig_main() 47 for (i=0; i<j; i++) if (!strcmp(toys.optargs[1], types[i])) break; in vconfig_main() 50 error_exit("%s: unknown '%s'", cmd, toys.optargs[1]); in vconfig_main() 60 xstrncpy(request.device1, toys.optargs[1], 16); in vconfig_main() 64 if (toys.optargs[2]) request.u.VID = atolx_range(toys.optargs[2], 0, 4094); in vconfig_main() 70 if (toys.optargs[2]) request.u.flag = atolx_range(toys.optargs[2], 0, 1); in vconfig_main() 71 if (toys.optargs[3]) request.vlan_qos = atolx_range(toys.optargs[3], 0, 7); in vconfig_main() 74 if (toys.optargs[2]) in vconfig_main() 75 request.u.skb_priority = atolx_range(toys.optargs[2], 0, INT_MAX); in vconfig_main() 76 if (toys.optargs[3]) request.vlan_qos = atolx_range(toys.optargs[3], 0, 7); in vconfig_main() [all …]
|
D | pwdx.c | 20 char **optargs; in pwdx_main() local 22 for (optargs = toys.optargs; *optargs; optargs++) { in pwdx_main() 26 path = xmprintf("/proc/%s/cwd", *optargs); in pwdx_main() 37 xprintf("%s: %s\n", *optargs, path); in pwdx_main()
|
D | insmod.c | 24 int fd = !strcmp(*toys.optargs, "-") ? 0 : xopen(*toys.optargs, O_RDONLY); in insmod_main() 28 while (toys.optargs[i] && in insmod_main() 29 strlen(toybuf) + strlen(toys.optargs[i]) + 2 < sizeof(toybuf)) in insmod_main() 31 strcat(toybuf, toys.optargs[i++]); in insmod_main() 40 char *path = !strcmp(*toys.optargs, "-") ? "/dev/stdin" : *toys.optargs; in insmod_main() 47 if (rc) perror_exit("failed to load %s", toys.optargs[0]); in insmod_main()
|
D | rfkill.c | 35 char **optargs = toys.optargs; in rfkill_main() local 39 if (!strcmp((char *[]){"list", "block", "unblock"}[tvar], *optargs)) break; in rfkill_main() 40 if (tvar == 3) error_exit("unknown cmd '%s'", *optargs); in rfkill_main() 52 if (!*++optargs) error_exit("'%s' needs IDENTIFIER", optargs[-1]); in rfkill_main() 54 if (!strcmp(rftypes[i].name, *optargs)) break; in rfkill_main() 55 if (i == ARRAY_LEN(rftypes)) idx = atolx_range(*optargs, 0, INT_MAX); in rfkill_main()
|
D | pivot_root.c | 30 if (syscall(__NR_pivot_root, toys.optargs[0], toys.optargs[1])) in pivot_root_main() 31 perror_exit("'%s' -> '%s'", toys.optargs[0], toys.optargs[1]); in pivot_root_main()
|
D | chroot.c | 27 if (chdir(*toys.optargs) || chroot(".")) perror_exit_raw(*toys.optargs); in chroot_main() 28 if (toys.optargs[1]) xexec(toys.optargs+1); in chroot_main()
|
D | stat.c | 96 xprintf("`%s'", *toys.optargs); in print_stat() 98 if (0<readlink(*toys.optargs, toybuf, sizeof(toybuf))) in print_stat() 162 for (; *toys.optargs; toys.optargs++) { in stat_main() 165 if (flagf && !statfs(*toys.optargs, (void *)&TT.stat)); in stat_main() 166 else if (!flagf && !lstat(*toys.optargs, (void *)&TT.stat)) { in stat_main() 173 perror_msg("'%s'", *toys.optargs); in stat_main() 180 if (*++f == 'n') xprintf("%s", *toys.optargs); in stat_main()
|
D | pmap.c | 27 char **optargs; in pmap_main() local 29 for (optargs = toys.optargs; *optargs; optargs++) { in pmap_main() 30 pid_t pid = atolx(*optargs); in pmap_main()
|
D | taskset.c | 49 char *s = *toys.optargs, *failed = "failed to %s %d's affinity"; in do_taskset() 76 k = strlen(s = *toys.optargs); in do_taskset() 82 if (digit > 15) error_exit("bad mask '%s'", *toys.optargs); in do_taskset() 104 xexec(toys.optargs+1); in taskset_main() 107 pid_t pid = strtol(toys.optargs[toys.optc-1], &c, 10); in taskset_main() 109 if (*c) error_exit("Not int %s", toys.optargs[1]); in taskset_main()
|
D | mkpasswd.c | 40 TT.salt = toys.optargs[1]; 61 if (!*toys.optargs) { 76 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt));
|
/external/toybox/toys/lsb/ |
D | mknod.c | 44 type = stridx("pcub", *toys.optargs[1]); 45 if (type == -1) perror_exit("bad type '%c'", *toys.optargs[1]); 49 major = atoi(toys.optargs[2]); 50 minor = atoi(toys.optargs[3]); 56 if (mknod(*toys.optargs, mode|modes[type], makedev(major, minor))) 57 perror_exit_raw(*toys.optargs);
|
D | su.c | 48 if (*toys.optargs && !strcmp("-", *toys.optargs)) { in su_main() 50 toys.optargs++; in su_main() 53 if (*toys.optargs) name = *(toys.optargs++); in su_main() 93 while ((*(argv++) = *(toys.optargs++))); in su_main()
|
D | umount.c | 109 char **optargs, *pm = "/proc/mounts"; in umount_main() local 137 } else for (optargs = toys.optargs; *optargs; optargs++) { in umount_main() 138 char *abs = xabspath(*optargs, 0); in umount_main() 149 do_umount(abs ? abs : *optargs, ml ? ml->device : 0, flags); in umount_main()
|
/external/toybox/toys/example/ |
D | skeleton.c | 67 char **optargs; local 82 for (optargs = toys.optargs; *optargs; optargs++) 83 printf("optarg=%s\n", *optargs);
|
/external/toybox/toys/posix/ |
D | link.c | 22 if (link(toys.optargs[0], toys.optargs[1])) in link_main() 23 perror_exit("couldn't link '%s' to '%s'", toys.optargs[1], in link_main() 24 toys.optargs[0]); in link_main()
|
/external/toybox/toys/android/ |
D | getprop.c | 78 if (*toys.optargs) { in getprop_main() 80 char *context = get_property_context(*toys.optargs); in getprop_main() 85 property_get(*toys.optargs, toybuf, toys.optargs[1] ? toys.optargs[1] : ""); in getprop_main()
|