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;
154 // toys/net/ifconfig.c
156 struct ifconfig_data {
163 char *filename; // -f read from filename instead of network
164 long quit_delay; // -q Exit after EOF from stdin after # seconds.
165 char *source_address; // -s Bind to a specific source address.
166 long port; // -p Bind to a specific source port.
167 long idle; // -W Wait # seconds for more data
168 long wait; // -w Wait # seconds for a connection.
171 // toys/net/netstat.c
173 struct netstat_data {
174 struct num_cache *inodes;
187 int ac, bat, therm, cool;
191 // toys/other/base64.c
199 // toys/other/blockdev.c
201 struct blockdev_data {
205 // toys/other/dos2unix.c
207 struct dos2unix_data {
211 // toys/other/fallocate.c
213 struct fallocate_data {
222 unsigned long long units;
226 // toys/other/hexedit.c
228 struct hexedit_data {
231 int numlen, undo, undolen;
235 // toys/other/hwclock.c
237 struct hwclock_data {
243 // toys/other/ionice.c
251 // toys/other/login.c
257 int login_timeout, login_fail_timeout;
260 // toys/other/losetup.c
262 struct losetup_data {
272 // toys/other/lspci.c
281 // toys/other/makedevs.c
283 struct makedevs_data {
296 // toys/other/mkpasswd.c
298 struct mkpasswd_data {
304 // toys/other/mkswap.c
310 // toys/other/modinfo.c
312 struct modinfo_data {
320 // toys/other/nsenter.c
322 struct nsenter_data {
327 // toys/other/oneit.c
333 // toys/other/shred.c
352 char *file, *pattern;
356 // toys/other/swapon.c
362 // toys/other/switch_root.c
364 struct switch_root_data {
370 // toys/other/timeout.c
372 struct timeout_data {
379 struct itimerval itv;
382 // toys/other/truncate.c
384 struct truncate_data {
400 // toys/pending/arp.c
412 // toys/pending/arping.c
416 unsigned long time_out;
421 unsigned long start, end;
422 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
426 // toys/pending/bootchartd.c
428 struct bootchartd_data {
430 long smpl_period_usec;
437 // toys/pending/brctl.c
443 // toys/pending/chrt.c
449 // toys/pending/compress.c
451 struct compress_data {
452 // Huffman codes: base offset and extra bits tables (length and distance)
453 char lenbits[29], distbits[30];
454 unsigned short lenbase[29], distbase[30];
455 void *fixdisthuff, *fixlithuff;
458 void (*crcfunc)(char *data, int len);
461 // Compressed data buffer
466 // Tables only used for deflation
467 unsigned short *hashhead, *hashchain;
470 // toys/pending/crond.c
478 time_t crontabs_dir_mtime;
482 // toys/pending/crontab.c
484 struct crontab_data {
494 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
495 struct timeval start;
499 unsigned char *buff, *bp;
501 unsigned long long offset;
505 // toys/pending/dhcp.c
514 struct arg_list *req_opt;
516 struct arg_list *pkt_opt;
522 // toys/pending/dhcp6.c
525 char *interface_name, *pidfile, *script;
526 long retry, timeout, errortimeout;
528 int length, state, request_length, sock, sock1, status, retval, retries;
530 uint8_t transction_id[3];
531 struct sockaddr_in6 input_socket6;
534 // toys/pending/dhcpd.c
541 // toys/pending/diff.c
546 struct arg_list *L_list;
548 int dir_num, size, is_binary, status, change, len[2];
552 // toys/pending/dumpleases.c
554 struct dumpleases_data {
558 // toys/pending/expr.c
561 char **tok; // current token, not on the stack since recursive calls mutate it
566 // toys/pending/fdisk.c
575 // toys/pending/fold.c
581 // toys/pending/fsck.c
587 struct double_list *devices;
597 // toys/pending/getfattr.c
599 struct getfattr_data {
603 // toys/pending/getty.c
615 struct termios termios;
619 // toys/pending/groupadd.c
621 struct groupadd_data {
625 // toys/pending/host.c
631 // toys/pending/iconv.c
643 char stats, singleline, flush, *filter_dev, gbuf[8192];
644 int sockfd, connected, from_ok, route_cmd;
645 int8_t addressfamily, is_addr;
648 // toys/pending/ipcrm.c
651 struct arg_list *qkey;
652 struct arg_list *qid;
653 struct arg_list *skey;
654 struct arg_list *sid;
655 struct arg_list *mkey;
656 struct arg_list *mid;
659 // toys/pending/ipcs.c
665 // toys/pending/klogd.c
673 // toys/pending/last.c
678 struct arg_list *list;
681 // toys/pending/logger.c
688 // toys/pending/lsof.c
693 struct stat *sought_files;
695 struct double_list *all_sockets;
696 struct double_list *files;
701 // toys/pending/microcom.c
703 struct microcom_data {
707 struct termios original_stdin_state, original_fd_state;
710 // toys/pending/mke2fs.c
713 // Command line arguments.
715 long bytes_per_inode;
716 long inodes; // Total inodes in filesystem.
717 long reserved_percent; // Integer precent of space to reserve for root.
718 char *gendir; // Where to read dirtree from.
721 struct dirtree *dt; // Tree of files to copy into the new filesystem.
722 unsigned treeblocks; // Blocks used by dt
723 unsigned treeinodes; // Inodes used by dt
725 unsigned blocks; // Total blocks in the filesystem.
726 unsigned freeblocks; // Free blocks in the filesystem.
727 unsigned inodespg; // Inodes per group
728 unsigned groups; // Total number of block groups.
729 unsigned blockbits; // Bits per block. (Also blocks per group.)
732 unsigned nextblock; // Next data block to allocate
733 unsigned nextgroup; // Next group we'll be allocating from
734 int fsfd; // File descriptor of filesystem (to output to).
736 struct ext2_superblock sb;
739 // toys/pending/modprobe.c
741 struct modprobe_data {
742 struct arg_list *probes;
743 struct arg_list *dbase[256];
747 void (*dbg)(char *format, ...);
750 // toys/pending/more.c
757 // toys/pending/openvt.c
760 unsigned long vt_num;
763 // toys/pending/ping.c
776 // toys/pending/route.c
782 // toys/pending/setfattr.c
784 struct setfattr_data {
796 // toys/pending/sulogin.c
798 struct sulogin_data {
800 struct termios crntio;
803 // toys/pending/syslogd.c
805 struct syslogd_data {
816 struct unsocks *lsocks; // list of listen sockets
817 struct logfile *lfiles; // list of write logfiles
821 // toys/pending/tar.c
826 struct arg_list *inc_file;
827 struct arg_list *exc_file;
829 struct arg_list *exc;
831 struct arg_list *inc, *pass;
832 void *inodes, *handle;
835 // toys/pending/tcpsvd.c
849 // toys/pending/telnet.c
859 struct termios def_term;
860 struct termios raw_term;
868 // toys/pending/telnetd.c
870 struct telnetd_data {
881 // toys/pending/tftp.c
888 struct sockaddr_storage inaddr;
892 // toys/pending/tftpd.c
904 short map[256]; //map of chars
908 // toys/pending/traceroute.c
910 struct traceroute_data {
917 struct arg_list *loose_source;
931 // toys/pending/useradd.c
933 struct useradd_data {
946 struct linestack *ls;
950 // toys/pending/watch.c
956 // toys/pending/wget.c
962 // toys/posix/chgrp.c
967 char *owner_name, *group_name;
971 // toys/posix/chmod.c
977 // toys/posix/cksum.c
980 unsigned crc_table[256];
1007 int (*callback)(struct dirtree *try);
1013 // toys/posix/cpio.c
1031 void (*do_cut)(int fd);
1034 // toys/posix/date.c
1048 struct arg_list *fstype;
1051 int column_widths[5];
1060 unsigned long depth, total;
1071 // toys/posix/expand.c
1073 struct expand_data {
1074 struct arg_list *tabs;
1076 unsigned tabcount, *tab;
1079 // toys/posix/file.c
1085 // toys/posix/find.c
1089 struct double_list *argdata;
1090 int topdir, xdev, depth;
1094 // toys/posix/grep.c
1104 char indelim, outdelim;
1107 // toys/posix/head.c
1120 // toys/posix/kill.c
1124 struct arg_list *olist;
1132 struct dirtree *files, *singledir;
1134 unsigned screen_width;
1139 // toys/posix/mkdir.c
1146 // toys/posix/mkfifo.c
1148 struct mkfifo_data {
1155 // toys/posix/nice.c
1171 // Count of consecutive blank lines for -l has to persist between files
1178 struct arg_list *output_base;
1185 unsigned types, leftover, star;
1186 char *buf; // Points to buffers[0] or buffers[1].
1187 char *bufs[2]; // Used to detect duplicate lines.
1191 // toys/posix/paste.c
1197 // toys/posix/patch.c
1204 struct double_list *current_hunk;
1205 long oldline, oldlen, newline, newlen;
1207 int context, state, filein, fileout, filepatch, hunknum;
1249 void *regexes, *snapshot;
1256 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1257 struct dirtree *threadparent;
1258 unsigned width, height;
1260 void *fields, *kfields;
1261 long long ticks, bits, time;
1262 int kcount, forcek, sortpos;
1263 int (*match_process)(long long *slot);
1264 void (*show_process)(void *tb);
1267 // toys/posix/renice.c
1269 struct renice_data {
1279 // processed pattern list
1280 struct double_list *pattern;
1282 char *nextline, *remember;
1283 void *restart, *lastregex;
1284 long nextlen, rememberlen, count;
1289 // toys/posix/sort.c
1292 char *key_separator;
1293 struct arg_list *raw_keys;
1295 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1302 // toys/posix/split.c
1312 // toys/posix/strings.c
1314 struct strings_data {
1318 // toys/posix/tail.c
1324 int file_no, ffd, *files;
1333 // toys/posix/touch.c
1341 // toys/posix/ulimit.c
1343 struct ulimit_data {
1347 // toys/posix/uniq.c
1356 // toys/posix/uudecode.c
1358 struct uudecode_data {
1365 unsigned long totals[4];
1368 // toys/posix/xargs.c
1377 long entries, bytes;
1381 extern union global_union {
1382 struct getprop_data getprop;
1383 struct log_data log;
1384 struct hello_data hello;
1385 struct skeleton_data skeleton;
1386 struct dmesg_data dmesg;
1387 struct hostname_data hostname;
1388 struct killall_data killall;
1389 struct md5sum_data md5sum;
1390 struct mknod_data mknod;
1391 struct mktemp_data mktemp;
1392 struct mount_data mount;
1393 struct passwd_data passwd;
1394 struct pidof_data pidof;
1395 struct seq_data seq;
1397 struct umount_data umount;
1398 struct ftpget_data ftpget;
1399 struct ifconfig_data ifconfig;
1400 struct netcat_data netcat;
1401 struct netstat_data netstat;
1402 struct tunctl_data tunctl;
1403 struct acpi_data acpi;
1404 struct base64_data base64;
1405 struct blockdev_data blockdev;
1406 struct dos2unix_data dos2unix;
1407 struct fallocate_data fallocate;
1408 struct free_data free;
1409 struct hexedit_data hexedit;
1410 struct hwclock_data hwclock;
1411 struct ionice_data ionice;
1412 struct login_data login;
1413 struct losetup_data losetup;
1414 struct lspci_data lspci;
1415 struct makedevs_data makedevs;
1416 struct mix_data mix;
1417 struct mkpasswd_data mkpasswd;
1418 struct mkswap_data mkswap;
1419 struct modinfo_data modinfo;
1420 struct nsenter_data nsenter;
1421 struct oneit_data oneit;
1422 struct shred_data shred;
1423 struct stat_data stat;
1424 struct swapon_data swapon;
1425 struct switch_root_data switch_root;
1426 struct timeout_data timeout;
1427 struct truncate_data truncate;
1428 struct xxd_data xxd;
1429 struct arp_data arp;
1430 struct arping_data arping;
1431 struct bootchartd_data bootchartd;
1432 struct brctl_data brctl;
1433 struct chrt_data chrt;
1434 struct compress_data compress;
1435 struct crond_data crond;
1436 struct crontab_data crontab;
1438 struct dhcp_data dhcp;
1439 struct dhcp6_data dhcp6;
1440 struct dhcpd_data dhcpd;
1441 struct diff_data diff;
1442 struct dumpleases_data dumpleases;
1443 struct expr_data expr;
1444 struct fdisk_data fdisk;
1445 struct fold_data fold;
1446 struct fsck_data fsck;
1447 struct getfattr_data getfattr;
1448 struct getty_data getty;
1449 struct groupadd_data groupadd;
1450 struct host_data host;
1451 struct iconv_data iconv;
1453 struct ipcrm_data ipcrm;
1454 struct ipcs_data ipcs;
1455 struct klogd_data klogd;
1456 struct last_data last;
1457 struct logger_data logger;
1458 struct lsof_data lsof;
1459 struct microcom_data microcom;
1460 struct mke2fs_data mke2fs;
1461 struct modprobe_data modprobe;
1462 struct more_data more;
1463 struct openvt_data openvt;
1464 struct ping_data ping;
1465 struct route_data route;
1466 struct setfattr_data setfattr;
1468 struct sulogin_data sulogin;
1469 struct syslogd_data syslogd;
1470 struct tar_data tar;
1471 struct tcpsvd_data tcpsvd;
1472 struct telnet_data telnet;
1473 struct telnetd_data telnetd;
1474 struct tftp_data tftp;
1475 struct tftpd_data tftpd;
1477 struct traceroute_data traceroute;
1478 struct useradd_data useradd;
1480 struct watch_data watch;
1481 struct wget_data wget;
1482 struct chgrp_data chgrp;
1483 struct chmod_data chmod;
1484 struct cksum_data cksum;
1485 struct cmp_data cmp;
1487 struct cpio_data cpio;
1488 struct cut_data cut;
1489 struct date_data date;
1492 struct env_data env;
1493 struct expand_data expand;
1494 struct file_data file;
1495 struct find_data find;
1496 struct grep_data grep;
1497 struct head_data head;
1499 struct kill_data kill;
1501 struct mkdir_data mkdir;
1502 struct mkfifo_data mkfifo;
1503 struct nice_data nice;
1506 struct paste_data paste;
1507 struct patch_data patch;
1509 struct renice_data renice;
1510 struct sed_data sed;
1511 struct sort_data sort;
1512 struct split_data split;
1513 struct strings_data strings;
1514 struct tail_data tail;
1515 struct tee_data tee;
1516 struct touch_data touch;
1517 struct ulimit_data ulimit;
1518 struct uniq_data uniq;
1519 struct uudecode_data uudecode;
1521 struct xargs_data xargs;