1 // toys/android/getprop.c
5 char **nv; // name/value pairs: even=name, odd=value
6 struct selabel_handle *handle;
16 // toys/example/hello.c
22 // toys/example/skeleton.c
24 struct skeleton_data {
29 struct arg_list *d_list;
51 // toys/lsb/hostname.c
53 struct hostname_data {
75 // Crypto variables blanked after summing
101 struct arg_list *optlist;
144 // toys/net/ifconfig.c
146 struct ifconfig_data {
153 char *filename; // -f read from filename instead of network
154 long quit_delay; // -q Exit after EOF from stdin after # seconds.
155 char *source_address; // -s Bind to a specific source address.
156 long port; // -p Bind to a specific source port.
157 long idle; // -W Wait # seconds for more data
158 long wait; // -w Wait # seconds for a connection.
161 // toys/net/netstat.c
163 struct netstat_data {
164 struct num_cache *inodes;
177 int ac, bat, therm, cool;
181 // toys/other/base64.c
189 // toys/other/blockdev.c
191 struct blockdev_data {
195 // toys/other/dos2unix.c
197 struct dos2unix_data {
201 // toys/other/fallocate.c
203 struct fallocate_data {
212 unsigned long long units;
216 // toys/other/hexedit.c
218 struct hexedit_data {
221 int numlen, undo, undolen;
225 // toys/other/hwclock.c
227 struct hwclock_data {
233 // toys/other/ionice.c
241 // toys/other/login.c
247 int login_timeout, login_fail_timeout;
250 // toys/other/losetup.c
252 struct losetup_data {
262 // toys/other/lspci.c
271 // toys/other/makedevs.c
273 struct makedevs_data {
286 // toys/other/mkpasswd.c
288 struct mkpasswd_data {
294 // toys/other/mkswap.c
300 // toys/other/modinfo.c
302 struct modinfo_data {
310 // toys/other/nsenter.c
312 struct nsenter_data {
317 // toys/other/oneit.c
323 // toys/other/shred.c
342 char *file, *pattern;
346 // toys/other/swapon.c
352 // toys/other/switch_root.c
354 struct switch_root_data {
360 // toys/other/timeout.c
362 struct timeout_data {
369 struct itimerval itv;
372 // toys/other/truncate.c
374 struct truncate_data {
390 // toys/pending/arp.c
402 // toys/pending/arping.c
406 unsigned long time_out;
411 unsigned long start, end;
412 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
416 // toys/pending/bootchartd.c
418 struct bootchartd_data {
420 long smpl_period_usec;
427 // toys/pending/brctl.c
433 // toys/pending/chrt.c
439 // toys/pending/compress.c
441 struct compress_data {
442 // Huffman codes: base offset and extra bits tables (length and distance)
443 char lenbits[29], distbits[30];
444 unsigned short lenbase[29], distbase[30];
445 void *fixdisthuff, *fixlithuff;
448 void (*crcfunc)(char *data, int len);
451 // Compressed data buffer
456 // Tables only used for deflation
457 unsigned short *hashhead, *hashchain;
460 // toys/pending/crond.c
468 time_t crontabs_dir_mtime;
472 // toys/pending/crontab.c
474 struct crontab_data {
484 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
485 struct timeval start;
489 unsigned char *buff, *bp;
491 unsigned long long offset;
495 // toys/pending/dhcp.c
504 struct arg_list *req_opt;
506 struct arg_list *pkt_opt;
512 // toys/pending/dhcp6.c
515 char *interface_name, *pidfile, *script;
516 long retry, timeout, errortimeout;
518 int length, state, request_length, sock, sock1, status, retval, retries;
520 uint8_t transction_id[3];
521 struct sockaddr_in6 input_socket6;
524 // toys/pending/dhcpd.c
531 // toys/pending/diff.c
536 struct arg_list *L_list;
538 int dir_num, size, is_binary, status, change, len[2];
542 // toys/pending/dumpleases.c
544 struct dumpleases_data {
548 // toys/pending/expr.c
551 char **tok; // current token, not on the stack since recursive calls mutate it
556 // toys/pending/fdisk.c
565 // toys/pending/fold.c
571 // toys/pending/fsck.c
577 struct double_list *devices;
587 // toys/pending/ftpget.c
590 long port; // char *port;
597 char buf[sizeof(struct sockaddr_storage)];
600 // toys/pending/getfattr.c
602 struct getfattr_data {
606 // toys/pending/getty.c
618 struct termios termios;
622 // toys/pending/groupadd.c
624 struct groupadd_data {
628 // toys/pending/host.c
634 // toys/pending/iconv.c
646 char stats, singleline, flush, *filter_dev, gbuf[8192];
647 int sockfd, connected, from_ok, route_cmd;
648 int8_t addressfamily, is_addr;
651 // toys/pending/ipcrm.c
654 struct arg_list *qkey;
655 struct arg_list *qid;
656 struct arg_list *skey;
657 struct arg_list *sid;
658 struct arg_list *mkey;
659 struct arg_list *mid;
662 // toys/pending/ipcs.c
668 // toys/pending/klogd.c
676 // toys/pending/last.c
681 struct arg_list *list;
684 // toys/pending/logger.c
691 // toys/pending/lsof.c
696 struct stat *sought_files;
698 struct double_list *all_sockets;
699 struct double_list *files;
704 // toys/pending/mke2fs.c
707 // Command line arguments.
709 long bytes_per_inode;
710 long inodes; // Total inodes in filesystem.
711 long reserved_percent; // Integer precent of space to reserve for root.
712 char *gendir; // Where to read dirtree from.
715 struct dirtree *dt; // Tree of files to copy into the new filesystem.
716 unsigned treeblocks; // Blocks used by dt
717 unsigned treeinodes; // Inodes used by dt
719 unsigned blocks; // Total blocks in the filesystem.
720 unsigned freeblocks; // Free blocks in the filesystem.
721 unsigned inodespg; // Inodes per group
722 unsigned groups; // Total number of block groups.
723 unsigned blockbits; // Bits per block. (Also blocks per group.)
726 unsigned nextblock; // Next data block to allocate
727 unsigned nextgroup; // Next group we'll be allocating from
728 int fsfd; // File descriptor of filesystem (to output to).
730 struct ext2_superblock sb;
733 // toys/pending/modprobe.c
735 struct modprobe_data {
736 struct arg_list *probes;
737 struct arg_list *dbase[256];
741 void (*dbg)(char *format, ...);
744 // toys/pending/more.c
751 // toys/pending/openvt.c
754 unsigned long vt_num;
757 // toys/pending/ping.c
770 // toys/pending/route.c
776 // toys/pending/setfattr.c
778 struct setfattr_data {
790 // toys/pending/sulogin.c
792 struct sulogin_data {
794 struct termios crntio;
797 // toys/pending/syslogd.c
799 struct syslogd_data {
810 struct unsocks *lsocks; // list of listen sockets
811 struct logfile *lfiles; // list of write logfiles
815 // toys/pending/tar.c
820 struct arg_list *inc_file;
821 struct arg_list *exc_file;
823 struct arg_list *exc;
825 struct arg_list *inc, *pass;
826 void *inodes, *handle;
829 // toys/pending/tcpsvd.c
843 // toys/pending/telnet.c
853 struct termios def_term;
854 struct termios raw_term;
862 // toys/pending/telnetd.c
864 struct telnetd_data {
875 // toys/pending/tftp.c
882 struct sockaddr_storage inaddr;
886 // toys/pending/tftpd.c
898 short map[256]; //map of chars
902 // toys/pending/traceroute.c
904 struct traceroute_data {
911 struct arg_list *loose_source;
925 // toys/pending/useradd.c
927 struct useradd_data {
940 struct linestack *ls;
944 // toys/pending/watch.c
950 // toys/pending/wget.c
956 // toys/posix/chgrp.c
961 char *owner_name, *group_name;
965 // toys/posix/chmod.c
971 // toys/posix/cksum.c
974 unsigned crc_table[256];
1001 int (*callback)(struct dirtree *try);
1007 // toys/posix/cpio.c
1025 void (*do_cut)(int fd);
1028 // toys/posix/date.c
1042 struct arg_list *fstype;
1045 int column_widths[5];
1054 unsigned long depth, total;
1065 // toys/posix/expand.c
1067 struct expand_data {
1068 struct arg_list *tabs;
1070 unsigned tabcount, *tab;
1073 // toys/posix/file.c
1079 // toys/posix/find.c
1083 struct double_list *argdata;
1084 int topdir, xdev, depth;
1088 // toys/posix/grep.c
1098 char indelim, outdelim;
1101 // toys/posix/head.c
1114 // toys/posix/kill.c
1118 struct arg_list *olist;
1126 struct dirtree *files, *singledir;
1128 unsigned screen_width;
1133 // toys/posix/mkdir.c
1140 // toys/posix/mkfifo.c
1142 struct mkfifo_data {
1149 // toys/posix/nice.c
1165 // Count of consecutive blank lines for -l has to persist between files
1172 struct arg_list *output_base;
1179 unsigned types, leftover, star;
1180 char *buf; // Points to buffers[0] or buffers[1].
1181 char *bufs[2]; // Used to detect duplicate lines.
1185 // toys/posix/paste.c
1191 // toys/posix/patch.c
1198 struct double_list *current_hunk;
1199 long oldline, oldlen, newline, newlen;
1201 int context, state, filein, fileout, filepatch, hunknum;
1243 void *regexes, *snapshot;
1250 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1251 struct dirtree *threadparent;
1252 unsigned width, height;
1254 void *fields, *kfields;
1255 long long ticks, bits, time;
1256 int kcount, forcek, sortpos;
1257 int (*match_process)(long long *slot);
1258 void (*show_process)(void *tb);
1261 // toys/posix/renice.c
1263 struct renice_data {
1273 // processed pattern list
1274 struct double_list *pattern;
1276 char *nextline, *remember;
1277 void *restart, *lastregex;
1278 long nextlen, rememberlen, count;
1283 // toys/posix/sort.c
1286 char *key_separator;
1287 struct arg_list *raw_keys;
1289 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1296 // toys/posix/split.c
1306 // toys/posix/strings.c
1308 struct strings_data {
1312 // toys/posix/tail.c
1318 int file_no, ffd, *files;
1327 // toys/posix/touch.c
1335 // toys/posix/ulimit.c
1337 struct ulimit_data {
1341 // toys/posix/uniq.c
1350 // toys/posix/uudecode.c
1352 struct uudecode_data {
1359 unsigned long totals[4];
1362 // toys/posix/xargs.c
1371 long entries, bytes;
1375 extern union global_union {
1376 struct getprop_data getprop;
1377 struct log_data log;
1378 struct hello_data hello;
1379 struct skeleton_data skeleton;
1380 struct dmesg_data dmesg;
1381 struct hostname_data hostname;
1382 struct killall_data killall;
1383 struct md5sum_data md5sum;
1384 struct mknod_data mknod;
1385 struct mktemp_data mktemp;
1386 struct mount_data mount;
1387 struct passwd_data passwd;
1388 struct pidof_data pidof;
1389 struct seq_data seq;
1391 struct umount_data umount;
1392 struct ifconfig_data ifconfig;
1393 struct netcat_data netcat;
1394 struct netstat_data netstat;
1395 struct tunctl_data tunctl;
1396 struct acpi_data acpi;
1397 struct base64_data base64;
1398 struct blockdev_data blockdev;
1399 struct dos2unix_data dos2unix;
1400 struct fallocate_data fallocate;
1401 struct free_data free;
1402 struct hexedit_data hexedit;
1403 struct hwclock_data hwclock;
1404 struct ionice_data ionice;
1405 struct login_data login;
1406 struct losetup_data losetup;
1407 struct lspci_data lspci;
1408 struct makedevs_data makedevs;
1409 struct mix_data mix;
1410 struct mkpasswd_data mkpasswd;
1411 struct mkswap_data mkswap;
1412 struct modinfo_data modinfo;
1413 struct nsenter_data nsenter;
1414 struct oneit_data oneit;
1415 struct shred_data shred;
1416 struct stat_data stat;
1417 struct swapon_data swapon;
1418 struct switch_root_data switch_root;
1419 struct timeout_data timeout;
1420 struct truncate_data truncate;
1421 struct xxd_data xxd;
1422 struct arp_data arp;
1423 struct arping_data arping;
1424 struct bootchartd_data bootchartd;
1425 struct brctl_data brctl;
1426 struct chrt_data chrt;
1427 struct compress_data compress;
1428 struct crond_data crond;
1429 struct crontab_data crontab;
1431 struct dhcp_data dhcp;
1432 struct dhcp6_data dhcp6;
1433 struct dhcpd_data dhcpd;
1434 struct diff_data diff;
1435 struct dumpleases_data dumpleases;
1436 struct expr_data expr;
1437 struct fdisk_data fdisk;
1438 struct fold_data fold;
1439 struct fsck_data fsck;
1440 struct ftpget_data ftpget;
1441 struct getfattr_data getfattr;
1442 struct getty_data getty;
1443 struct groupadd_data groupadd;
1444 struct host_data host;
1445 struct iconv_data iconv;
1447 struct ipcrm_data ipcrm;
1448 struct ipcs_data ipcs;
1449 struct klogd_data klogd;
1450 struct last_data last;
1451 struct logger_data logger;
1452 struct lsof_data lsof;
1453 struct mke2fs_data mke2fs;
1454 struct modprobe_data modprobe;
1455 struct more_data more;
1456 struct openvt_data openvt;
1457 struct ping_data ping;
1458 struct route_data route;
1459 struct setfattr_data setfattr;
1461 struct sulogin_data sulogin;
1462 struct syslogd_data syslogd;
1463 struct tar_data tar;
1464 struct tcpsvd_data tcpsvd;
1465 struct telnet_data telnet;
1466 struct telnetd_data telnetd;
1467 struct tftp_data tftp;
1468 struct tftpd_data tftpd;
1470 struct traceroute_data traceroute;
1471 struct useradd_data useradd;
1473 struct watch_data watch;
1474 struct wget_data wget;
1475 struct chgrp_data chgrp;
1476 struct chmod_data chmod;
1477 struct cksum_data cksum;
1478 struct cmp_data cmp;
1480 struct cpio_data cpio;
1481 struct cut_data cut;
1482 struct date_data date;
1485 struct env_data env;
1486 struct expand_data expand;
1487 struct file_data file;
1488 struct find_data find;
1489 struct grep_data grep;
1490 struct head_data head;
1492 struct kill_data kill;
1494 struct mkdir_data mkdir;
1495 struct mkfifo_data mkfifo;
1496 struct nice_data nice;
1499 struct paste_data paste;
1500 struct patch_data patch;
1502 struct renice_data renice;
1503 struct sed_data sed;
1504 struct sort_data sort;
1505 struct split_data split;
1506 struct strings_data strings;
1507 struct tail_data tail;
1508 struct tee_data tee;
1509 struct touch_data touch;
1510 struct ulimit_data ulimit;
1511 struct uniq_data uniq;
1512 struct uudecode_data uudecode;
1514 struct xargs_data xargs;