/external/toybox/toys/other/ |
D | vconfig.c | 33 char *cmd = *toys.optargs; in vconfig_main() 43 for (i=0; i<j; i++) if (!strcmp(toys.optargs[1], types[i])) break; in vconfig_main() 46 error_exit("%s: unknown '%s'", cmd, toys.optargs[1]); in vconfig_main() 57 xstrncpy(request.device1, toys.optargs[1], sizeof(request.device1)); in vconfig_main() 61 if (toys.optargs[2]) request.u.VID = atolx_range(toys.optargs[2], 0, 4094); in vconfig_main() 67 if (toys.optargs[2]) request.u.flag = atolx_range(toys.optargs[2], 0, 1); in vconfig_main() 68 if (toys.optargs[3]) request.vlan_qos = atolx_range(toys.optargs[3], 0, 7); in vconfig_main() 71 if (toys.optargs[2]) in vconfig_main() 72 request.u.skb_priority = atolx_range(toys.optargs[2], 0, INT_MAX); in vconfig_main() 73 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() 25 sprintf(toybuf, "/proc/%d/cwd", atoi(*optargs)); in pwdx_main() 31 xprintf("%s: %s\n", *optargs, path); in pwdx_main()
|
D | i2ctools.c | 186 i2cdetect_dash_F(atolx_range(*toys.optargs, 0, INT_MAX)); in i2cdetect_main() 196 bus = atolx_range(*toys.optargs, 0, INT_MAX); in i2cdetect_main() 198 first = atolx_range(toys.optargs[1], 0, 0x7f); in i2cdetect_main() 199 last = atolx_range(toys.optargs[2], 0, 0x7f); in i2cdetect_main() 235 int bus = atolx_range(toys.optargs[0], 0, INT_MAX); in i2cdump_main() 236 int chip = atolx_range(toys.optargs[1], 0, 0x7f); in i2cdump_main() 261 int bus = atolx_range(toys.optargs[0], 0, INT_MAX); in i2cget_main() 262 int chip = atolx_range(toys.optargs[1], 0, 0x7f); in i2cget_main() 263 int addr = atolx_range(toys.optargs[2], 0, 0xff); in i2cget_main() 280 int bus = atolx_range(toys.optargs[0], 0, INT_MAX); in i2cset_main() [all …]
|
D | insmod.c | 28 int fd = xopenro(*toys.optargs); in insmod_main() 32 while (toys.optargs[i] && in insmod_main() 33 strlen(toybuf) + strlen(toys.optargs[i]) + 2 < sizeof(toybuf)) in insmod_main() 35 strcat(toybuf, toys.optargs[i++]); in insmod_main() 44 char *path = !strcmp(*toys.optargs, "-") ? "/dev/stdin" : *toys.optargs; in insmod_main() 51 if (rc) perror_exit("failed to load %s", toys.optargs[0]); in insmod_main()
|
D | devmem.c | 24 unsigned long addr = atolx(*toys.optargs); in devmem_main() 31 if ((i=stridx("1248", *toys.optargs[1]))==-1 || toys.optargs[1][1]) in devmem_main() 32 error_exit("bad width: %s", toys.optargs[1]); in devmem_main() 37 if (writing) data = atolx_range(toys.optargs[2], 0, (1ULL<<(8*bytes))-1); in devmem_main() 62 printf((!strchr(*toys.optargs, 'x')) ? "%0*lld\n" : "0x%0*llx\n", in devmem_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 | chrt.c | 70 if (toys.optflags==FLAG_p && !*toys.optargs) { in chrt_main() 84 if (!*toys.optargs) help_exit("no PRIORITY"); in chrt_main() 85 if (!toys.optargs[1] == !(toys.optflags&FLAG_p)) in chrt_main() 90 pri = atolx_range(*toys.optargs, sched_get_priority_min(pol), in chrt_main() 97 if (*(toys.optargs+1)) xexec(toys.optargs+1); in chrt_main()
|
D | chroot.c | 27 if (chdir(*toys.optargs) || chroot(".")) { in chroot_main() 29 perror_exit_raw(*toys.optargs); in chroot_main() 31 if (toys.optargs[1]) xexec(toys.optargs+1); in chroot_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 | blkid.c | 81 if (*toys.optargs && strcmp(s, *toys.optargs)) return; in flagshow() 82 printf("%s\n", *toys.optargs ? name : s); in flagshow() 83 if (*toys.optargs) xexit(); in flagshow() 197 if (*toys.optargs && !FLAG(L) && !FLAG(U)) loopfiles(toys.optargs, do_blkid); in blkid_main() 224 loopfiles(toys.optargs, do_blkid); in fstype_main()
|
/external/toybox/toys/pending/ |
D | groupadd.c | 52 entry = xmprintf("%s:%s:%ld:", *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 | arp.c | 127 resolve_host(toys.optargs[0], &sa); in check_flags() 143 if (!toys.optargs[1]) error_exit("bad syntax"); in set_entry() 146 char *ptr = toys.optargs[1]; in set_entry() 163 xstrncpy(ifre.ifr_name, toys.optargs[1], IFNAMSIZ); in set_entry() 171 if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2)); in set_entry() 176 if (toys.optflags & FLAG_v) xprintf("Entry set for %s\n", toys.optargs[0]); in set_entry() 200 if (toys.optargs[1]) check_flags(&flags, (toys.optargs+1)); in delete_entry() 205 if (toys.optflags & FLAG_v) xprintf("Delete entry for %s\n", toys.optargs[0]); in delete_entry() 234 if (!toys.optargs[0]) error_exit("host name req"); in arp_main() 235 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 | more.c | 97 loopfiles(toys.optargs, do_cat_operation); in more_main() 114 char *filename = *toys.optargs; in more_main() 161 if (*toys.optargs && *++toys.optargs) { in more_main() 162 input_key = prompt(cin, "--More--(Next file: %s)", *toys.optargs); in more_main() 165 } while (*toys.optargs); in more_main()
|
/external/toybox/toys/net/ |
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 | ftpget.c | 96 char *s, *remote = toys.optargs[2]; in ftpget_main() 105 if (!remote) remote = toys.optargs[1]; in ftpget_main() 108 TT.fd = xconnectany(xgetaddrinfo(*toys.optargs, TT.p, 0, SOCK_STREAM, 0, in ftpget_main() 120 ftp_line("RNFR", toys.optargs[1], 350); in ftpget_main() 121 ftp_line("RNTO", toys.optargs[2], 250); in ftpget_main() 122 } else if (toys.optflags & FLAG_M) ftp_line("MKD", toys.optargs[1], 257); in ftpget_main() 123 else if (toys.optflags & FLAG_d) ftp_line("DELE", toys.optargs[1], 250); in ftpget_main() 124 else if (toys.optflags & FLAG_D) ftp_line("RMD", toys.optargs[1], 250); in ftpget_main() 163 if (strcmp(toys.optargs[1], "-")) in ftpget_main() 164 ii = xcreate(toys.optargs[1], in ftpget_main()
|
/external/toybox/toys/lsb/ |
D | mknod.c | 43 type = stridx("pcub", *toys.optargs[1]); in mknod_main() 44 if (type == -1) perror_exit("bad type '%c'", *toys.optargs[1]); in mknod_main() 48 major = atoi(toys.optargs[2]); in mknod_main() 49 minor = atoi(toys.optargs[3]); in mknod_main() 55 if (mknod(*toys.optargs, mode|modes[type], dev_makedev(major, minor))) in mknod_main() 56 perror_exit_raw(*toys.optargs); in mknod_main()
|
D | su.c | 51 if (*toys.optargs && !strcmp("-", *toys.optargs)) { 53 toys.optargs++; 56 if (*toys.optargs) name = *(toys.optargs++); 87 while ((*(argv++) = *(toys.optargs++)));
|
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/android/ |
D | sendevent.c | 24 int fd = xopen(*toys.optargs, O_RDWR); in sendevent_main() 29 perror_exit("EVIOCGVERSION failed for %s", *toys.optargs); in sendevent_main() 33 ev.type = atoi(toys.optargs[1]); in sendevent_main() 34 ev.code = atoi(toys.optargs[2]); in sendevent_main() 35 ev.value = atoi(toys.optargs[3]); in sendevent_main()
|
D | log.c | 43 for (i = 0; toys.optargs[i]; i++) { in log_main() 45 if ((s-toybuf)+strlen(toys.optargs[i])>=1024) { in log_main() 46 memcpy(s, toys.optargs[i], 1024-(s-toybuf)); in log_main() 52 s = stpcpy(s, toys.optargs[i]); in log_main()
|
/external/toybox/toys/example/ |
D | skeleton.c | 69 char **optargs; local 84 for (optargs = toys.optargs; *optargs; optargs++) 85 printf("optarg=%s\n", *optargs);
|
/external/toybox/toys/posix/ |
D | test.c | 106 if (!toys.optc || strcmp("]", toys.optargs[--toys.optc])) in test_main() 116 result = do_test(toys.optargs+pos, &len); in test_main() 120 if (toys.optargs[pos+1]) { in test_main() 121 if (!strcmp("!", toys.optargs[pos])) { in test_main() 125 if (!strcmp("(", toys.optargs[pos])) { in test_main() 131 result = *toys.optargs[pos++]; in test_main() 133 s = toys.optargs[pos]; in test_main() 146 s = toys.optargs[++pos]; in test_main()
|
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()
|