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;
52 // toys/lsb/hostname.c
54 struct hostname_data {
76 // Crypto variables blanked after summing
102 struct arg_list *optlist;
157 // toys/net/ifconfig.c
159 struct ifconfig_data {
163 // toys/net/microcom.c
165 struct microcom_data {
169 struct termios original_stdin_state, original_fd_state;
175 char *filename; // -f read from filename instead of network
176 long quit_delay; // -q Exit after EOF from stdin after # seconds.
177 char *source_address; // -s Bind to a specific source address.
178 long port; // -p Bind to a specific source port.
179 long idle; // -W Wait # seconds for more data
180 long wait; // -w Wait # seconds for a connection.
183 // toys/net/netstat.c
185 struct netstat_data {
186 struct num_cache *inodes;
199 int ac, bat, therm, cool;
203 // toys/other/base64.c
211 // toys/other/blockdev.c
213 struct blockdev_data {
223 // toys/other/dos2unix.c
225 struct dos2unix_data {
229 // toys/other/fallocate.c
231 struct fallocate_data {
240 unsigned long long units;
244 // toys/other/hexedit.c
246 struct hexedit_data {
249 int numlen, undo, undolen;
253 // toys/other/hwclock.c
255 struct hwclock_data {
261 // toys/other/ionice.c
269 // toys/other/login.c
275 int login_timeout, login_fail_timeout;
278 // toys/other/losetup.c
280 struct losetup_data {
290 // toys/other/lspci.c
299 // toys/other/makedevs.c
301 struct makedevs_data {
314 // toys/other/mkpasswd.c
316 struct mkpasswd_data {
322 // toys/other/mkswap.c
328 // toys/other/modinfo.c
330 struct modinfo_data {
338 // toys/other/nsenter.c
340 struct nsenter_data {
345 // toys/other/oneit.c
351 // toys/other/setfattr.c
353 struct setfattr_data {
357 // toys/other/shred.c
376 char *file, *pattern;
380 // toys/other/swapon.c
386 // toys/other/switch_root.c
388 struct switch_root_data {
394 // toys/other/timeout.c
396 struct timeout_data {
403 struct itimerval itv;
406 // toys/other/truncate.c
408 struct truncate_data {
424 // toys/pending/arp.c
436 // toys/pending/arping.c
440 unsigned long time_out;
445 unsigned long start, end;
446 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
450 // toys/pending/bootchartd.c
452 struct bootchartd_data {
454 long smpl_period_usec;
461 // toys/pending/brctl.c
467 // toys/pending/compress.c
469 struct compress_data {
470 // Huffman codes: base offset and extra bits tables (length and distance)
471 char lenbits[29], distbits[30];
472 unsigned short lenbase[29], distbase[30];
473 void *fixdisthuff, *fixlithuff;
476 void (*crcfunc)(char *data, int len);
479 // Compressed data buffer
484 // Tables only used for deflation
485 unsigned short *hashhead, *hashchain;
488 // toys/pending/crond.c
496 time_t crontabs_dir_mtime;
500 // toys/pending/crontab.c
502 struct crontab_data {
510 int show_xfer, show_records;
511 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
512 struct timeval start;
516 unsigned char *buff, *bp;
518 unsigned long long offset;
522 // toys/pending/dhcp.c
531 struct arg_list *req_opt;
533 struct arg_list *pkt_opt;
539 // toys/pending/dhcp6.c
542 char *interface_name, *pidfile, *script;
543 long retry, timeout, errortimeout;
545 int length, state, request_length, sock, sock1, status, retval, retries;
547 uint8_t transction_id[3];
548 struct sockaddr_in6 input_socket6;
551 // toys/pending/dhcpd.c
558 // toys/pending/diff.c
563 struct arg_list *L_list;
565 int dir_num, size, is_binary, status, change, len[2];
569 // toys/pending/dumpleases.c
571 struct dumpleases_data {
575 // toys/pending/expr.c
578 char **tok; // current token, not on the stack since recursive calls mutate it
583 // toys/pending/fdisk.c
592 // toys/pending/fmt.c
598 // toys/pending/fold.c
604 // toys/pending/fsck.c
610 struct double_list *devices;
620 // toys/pending/getfattr.c
622 struct getfattr_data {
626 // toys/pending/getty.c
638 struct termios termios;
642 // toys/pending/groupadd.c
644 struct groupadd_data {
648 // toys/pending/gzip.c
654 // toys/pending/host.c
663 char stats, singleline, flush, *filter_dev, gbuf[8192];
664 int sockfd, connected, from_ok, route_cmd;
665 int8_t addressfamily, is_addr;
668 // toys/pending/ipcrm.c
671 struct arg_list *qkey;
672 struct arg_list *qid;
673 struct arg_list *skey;
674 struct arg_list *sid;
675 struct arg_list *mkey;
676 struct arg_list *mid;
679 // toys/pending/ipcs.c
685 // toys/pending/klogd.c
693 // toys/pending/last.c
698 struct arg_list *list;
701 // toys/pending/lsof.c
706 struct stat *sought_files;
707 struct double_list *all_sockets, *files;
708 int last_shown_pid, shown_header;
711 // toys/pending/mke2fs.c
714 // Command line arguments.
716 long bytes_per_inode;
717 long inodes; // Total inodes in filesystem.
718 long reserved_percent; // Integer precent of space to reserve for root.
719 char *gendir; // Where to read dirtree from.
722 struct dirtree *dt; // Tree of files to copy into the new filesystem.
723 unsigned treeblocks; // Blocks used by dt
724 unsigned treeinodes; // Inodes used by dt
726 unsigned blocks; // Total blocks in the filesystem.
727 unsigned freeblocks; // Free blocks in the filesystem.
728 unsigned inodespg; // Inodes per group
729 unsigned groups; // Total number of block groups.
730 unsigned blockbits; // Bits per block. (Also blocks per group.)
733 unsigned nextblock; // Next data block to allocate
734 unsigned nextgroup; // Next group we'll be allocating from
735 int fsfd; // File descriptor of filesystem (to output to).
737 struct ext2_superblock sb;
740 // toys/pending/modprobe.c
742 struct modprobe_data {
743 struct arg_list *dirs;
745 struct arg_list *probes;
746 struct arg_list *dbase[256];
752 // toys/pending/more.c
759 // toys/pending/openvt.c
762 unsigned long vt_num;
765 // toys/pending/ping.c
780 // toys/pending/route.c
794 // toys/pending/stty.c
800 unsigned output_cols;
803 // toys/pending/sulogin.c
805 struct sulogin_data {
807 struct termios crntio;
810 // toys/pending/syslogd.c
812 struct syslogd_data {
823 struct unsocks *lsocks; // list of listen sockets
824 struct logfile *lfiles; // list of write logfiles
828 // toys/pending/tar.c
833 struct arg_list *inc_file;
834 struct arg_list *exc_file;
836 struct arg_list *exc;
838 struct arg_list *inc, *pass;
839 void *inodes, *handle;
842 // toys/pending/tcpsvd.c
856 // toys/pending/telnet.c
866 struct termios def_term;
867 struct termios raw_term;
875 // toys/pending/telnetd.c
877 struct telnetd_data {
888 // toys/pending/tftp.c
895 struct sockaddr_storage inaddr;
899 // toys/pending/tftpd.c
911 short map[256]; //map of chars
915 // toys/pending/traceroute.c
917 struct traceroute_data {
924 struct arg_list *loose_source;
938 // toys/pending/useradd.c
940 struct useradd_data {
953 struct linestack *ls;
957 // toys/pending/watch.c
963 // toys/pending/wget.c
969 // toys/posix/chgrp.c
974 char *owner_name, *group_name;
978 // toys/posix/chmod.c
984 // toys/posix/cksum.c
987 unsigned crc_table[256];
1002 // install's options
1014 int (*callback)(struct dirtree *try);
1020 // toys/posix/cpio.c
1033 struct arg_list *select[5]; // we treat them the same, so loop through
1039 // toys/posix/date.c
1052 struct arg_list *fstype;
1055 int column_widths[5];
1064 unsigned long depth, total;
1075 // toys/posix/expand.c
1077 struct expand_data {
1078 struct arg_list *tabs;
1080 unsigned tabcount, *tab;
1083 // toys/posix/file.c
1089 // toys/posix/find.c
1093 struct double_list *argdata;
1094 int topdir, xdev, depth;
1099 // toys/posix/grep.c
1111 char indelim, outdelim;
1115 // toys/posix/head.c
1123 // toys/posix/iconv.c
1138 // toys/posix/kill.c
1142 struct arg_list *olist;
1145 // toys/posix/logger.c
1147 struct logger_data {
1158 struct dirtree *files, *singledir;
1160 unsigned screen_width;
1165 // toys/posix/mkdir.c
1172 // toys/posix/mkfifo.c
1174 struct mkfifo_data {
1181 // toys/posix/nice.c
1197 // Count of consecutive blank lines for -l has to persist between files
1204 struct arg_list *output_base;
1211 unsigned types, leftover, star;
1212 char *buf; // Points to buffers[0] or buffers[1].
1213 char *bufs[2]; // Used to detect duplicate lines.
1217 // toys/posix/paste.c
1225 // toys/posix/patch.c
1232 struct double_list *current_hunk;
1233 long oldline, oldlen, newline, newlen;
1235 int context, state, filein, fileout, filepatch, hunknum;
1278 void *regexes, *snapshot;
1285 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1286 struct dirtree *threadparent;
1287 unsigned width, height;
1289 void *fields, *kfields;
1290 long long ticks, bits, time;
1291 int kcount, forcek, sortpos;
1292 int (*match_process)(long long *slot);
1293 void (*show_process)(void *tb);
1296 // toys/posix/renice.c
1298 struct renice_data {
1308 // processed pattern list
1309 struct double_list *pattern;
1311 char *nextline, *remember;
1312 void *restart, *lastregex;
1313 long nextlen, rememberlen, count;
1318 // toys/posix/sort.c
1321 char *key_separator;
1322 struct arg_list *raw_keys;
1324 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1331 // toys/posix/split.c
1341 // toys/posix/strings.c
1343 struct strings_data {
1348 // toys/posix/tail.c
1354 int file_no, ffd, *files;
1363 // toys/posix/touch.c
1371 // toys/posix/ulimit.c
1373 struct ulimit_data {
1377 // toys/posix/uniq.c
1386 // toys/posix/uudecode.c
1388 struct uudecode_data {
1395 unsigned long totals[4];
1398 // toys/posix/xargs.c
1407 long entries, bytes;
1411 extern union global_union {
1412 struct getprop_data getprop;
1413 struct log_data log;
1414 struct hello_data hello;
1415 struct skeleton_data skeleton;
1416 struct dmesg_data dmesg;
1417 struct hostname_data hostname;
1418 struct killall_data killall;
1419 struct md5sum_data md5sum;
1420 struct mknod_data mknod;
1421 struct mktemp_data mktemp;
1422 struct mount_data mount;
1423 struct passwd_data passwd;
1424 struct pidof_data pidof;
1425 struct seq_data seq;
1427 struct umount_data umount;
1428 struct ftpget_data ftpget;
1429 struct ifconfig_data ifconfig;
1430 struct microcom_data microcom;
1431 struct netcat_data netcat;
1432 struct netstat_data netstat;
1433 struct tunctl_data tunctl;
1434 struct acpi_data acpi;
1435 struct base64_data base64;
1436 struct blockdev_data blockdev;
1437 struct chrt_data chrt;
1438 struct dos2unix_data dos2unix;
1439 struct fallocate_data fallocate;
1440 struct free_data free;
1441 struct hexedit_data hexedit;
1442 struct hwclock_data hwclock;
1443 struct ionice_data ionice;
1444 struct login_data login;
1445 struct losetup_data losetup;
1446 struct lspci_data lspci;
1447 struct makedevs_data makedevs;
1448 struct mix_data mix;
1449 struct mkpasswd_data mkpasswd;
1450 struct mkswap_data mkswap;
1451 struct modinfo_data modinfo;
1452 struct nsenter_data nsenter;
1453 struct oneit_data oneit;
1454 struct setfattr_data setfattr;
1455 struct shred_data shred;
1456 struct stat_data stat;
1457 struct swapon_data swapon;
1458 struct switch_root_data switch_root;
1459 struct timeout_data timeout;
1460 struct truncate_data truncate;
1461 struct xxd_data xxd;
1462 struct arp_data arp;
1463 struct arping_data arping;
1464 struct bootchartd_data bootchartd;
1465 struct brctl_data brctl;
1466 struct compress_data compress;
1467 struct crond_data crond;
1468 struct crontab_data crontab;
1470 struct dhcp_data dhcp;
1471 struct dhcp6_data dhcp6;
1472 struct dhcpd_data dhcpd;
1473 struct diff_data diff;
1474 struct dumpleases_data dumpleases;
1475 struct expr_data expr;
1476 struct fdisk_data fdisk;
1477 struct fmt_data fmt;
1478 struct fold_data fold;
1479 struct fsck_data fsck;
1480 struct getfattr_data getfattr;
1481 struct getty_data getty;
1482 struct groupadd_data groupadd;
1483 struct gzip_data gzip;
1484 struct host_data host;
1486 struct ipcrm_data ipcrm;
1487 struct ipcs_data ipcs;
1488 struct klogd_data klogd;
1489 struct last_data last;
1490 struct lsof_data lsof;
1491 struct mke2fs_data mke2fs;
1492 struct modprobe_data modprobe;
1493 struct more_data more;
1494 struct openvt_data openvt;
1495 struct ping_data ping;
1496 struct route_data route;
1498 struct stty_data stty;
1499 struct sulogin_data sulogin;
1500 struct syslogd_data syslogd;
1501 struct tar_data tar;
1502 struct tcpsvd_data tcpsvd;
1503 struct telnet_data telnet;
1504 struct telnetd_data telnetd;
1505 struct tftp_data tftp;
1506 struct tftpd_data tftpd;
1508 struct traceroute_data traceroute;
1509 struct useradd_data useradd;
1511 struct watch_data watch;
1512 struct wget_data wget;
1513 struct chgrp_data chgrp;
1514 struct chmod_data chmod;
1515 struct cksum_data cksum;
1516 struct cmp_data cmp;
1518 struct cpio_data cpio;
1519 struct cut_data cut;
1520 struct date_data date;
1523 struct env_data env;
1524 struct expand_data expand;
1525 struct file_data file;
1526 struct find_data find;
1527 struct grep_data grep;
1528 struct head_data head;
1529 struct iconv_data iconv;
1531 struct kill_data kill;
1532 struct logger_data logger;
1534 struct mkdir_data mkdir;
1535 struct mkfifo_data mkfifo;
1536 struct nice_data nice;
1539 struct paste_data paste;
1540 struct patch_data patch;
1542 struct renice_data renice;
1543 struct sed_data sed;
1544 struct sort_data sort;
1545 struct split_data split;
1546 struct strings_data strings;
1547 struct tail_data tail;
1548 struct tee_data tee;
1549 struct touch_data touch;
1550 struct ulimit_data ulimit;
1551 struct uniq_data uniq;
1552 struct uudecode_data uudecode;
1554 struct xargs_data xargs;