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;
42 // toys/lsb/hostname.c
44 struct hostname_data {
66 // Crypto variables blanked after summing
92 struct arg_list *optlist;
145 // toys/net/ifconfig.c
147 struct ifconfig_data {
151 // toys/net/microcom.c
153 struct microcom_data {
157 struct termios original_stdin_state, original_fd_state;
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/dmesg.c
562 // toys/pending/dumpleases.c
564 struct dumpleases_data {
568 // toys/pending/expr.c
571 char **tok; // current token, not on the stack since recursive calls mutate it
576 // toys/pending/fdisk.c
585 // toys/pending/fold.c
591 // toys/pending/fsck.c
597 struct double_list *devices;
607 // toys/pending/getfattr.c
609 struct getfattr_data {
613 // toys/pending/getty.c
625 struct termios termios;
629 // toys/pending/groupadd.c
631 struct groupadd_data {
635 // toys/pending/host.c
641 // toys/pending/iconv.c
653 char stats, singleline, flush, *filter_dev, gbuf[8192];
654 int sockfd, connected, from_ok, route_cmd;
655 int8_t addressfamily, is_addr;
658 // toys/pending/ipcrm.c
661 struct arg_list *qkey;
662 struct arg_list *qid;
663 struct arg_list *skey;
664 struct arg_list *sid;
665 struct arg_list *mkey;
666 struct arg_list *mid;
669 // toys/pending/ipcs.c
675 // toys/pending/klogd.c
683 // toys/pending/last.c
688 struct arg_list *list;
691 // toys/pending/logger.c
698 // toys/pending/lsof.c
703 struct stat *sought_files;
705 struct double_list *all_sockets;
706 struct double_list *files;
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
778 // toys/pending/route.c
784 // toys/pending/setfattr.c
786 struct setfattr_data {
798 // toys/pending/sulogin.c
800 struct sulogin_data {
802 struct termios crntio;
805 // toys/pending/syslogd.c
807 struct syslogd_data {
818 struct unsocks *lsocks; // list of listen sockets
819 struct logfile *lfiles; // list of write logfiles
823 // toys/pending/tar.c
828 struct arg_list *inc_file;
829 struct arg_list *exc_file;
831 struct arg_list *exc;
833 struct arg_list *inc, *pass;
834 void *inodes, *handle;
837 // toys/pending/tcpsvd.c
851 // toys/pending/telnet.c
861 struct termios def_term;
862 struct termios raw_term;
870 // toys/pending/telnetd.c
872 struct telnetd_data {
883 // toys/pending/tftp.c
890 struct sockaddr_storage inaddr;
894 // toys/pending/tftpd.c
906 short map[256]; //map of chars
910 // toys/pending/traceroute.c
912 struct traceroute_data {
919 struct arg_list *loose_source;
933 // toys/pending/useradd.c
935 struct useradd_data {
948 struct linestack *ls;
952 // toys/pending/watch.c
958 // toys/pending/wget.c
964 // toys/posix/chgrp.c
969 char *owner_name, *group_name;
973 // toys/posix/chmod.c
979 // toys/posix/cksum.c
982 unsigned crc_table[256];
1009 int (*callback)(struct dirtree *try);
1015 // toys/posix/cpio.c
1033 void (*do_cut)(int fd);
1036 // toys/posix/date.c
1049 struct arg_list *fstype;
1052 int column_widths[5];
1061 unsigned long depth, total;
1072 // toys/posix/expand.c
1074 struct expand_data {
1075 struct arg_list *tabs;
1077 unsigned tabcount, *tab;
1080 // toys/posix/file.c
1086 // toys/posix/find.c
1090 struct double_list *argdata;
1091 int topdir, xdev, depth;
1095 // toys/posix/grep.c
1105 char indelim, outdelim;
1108 // toys/posix/head.c
1121 // toys/posix/kill.c
1125 struct arg_list *olist;
1134 struct dirtree *files, *singledir;
1136 unsigned screen_width;
1141 // toys/posix/mkdir.c
1148 // toys/posix/mkfifo.c
1150 struct mkfifo_data {
1157 // toys/posix/nice.c
1173 // Count of consecutive blank lines for -l has to persist between files
1180 struct arg_list *output_base;
1187 unsigned types, leftover, star;
1188 char *buf; // Points to buffers[0] or buffers[1].
1189 char *bufs[2]; // Used to detect duplicate lines.
1193 // toys/posix/paste.c
1201 // toys/posix/patch.c
1208 struct double_list *current_hunk;
1209 long oldline, oldlen, newline, newlen;
1211 int context, state, filein, fileout, filepatch, hunknum;
1253 void *regexes, *snapshot;
1260 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1261 struct dirtree *threadparent;
1262 unsigned width, height;
1264 void *fields, *kfields;
1265 long long ticks, bits, time;
1266 int kcount, forcek, sortpos;
1267 int (*match_process)(long long *slot);
1268 void (*show_process)(void *tb);
1271 // toys/posix/renice.c
1273 struct renice_data {
1283 // processed pattern list
1284 struct double_list *pattern;
1286 char *nextline, *remember;
1287 void *restart, *lastregex;
1288 long nextlen, rememberlen, count;
1293 // toys/posix/sort.c
1296 char *key_separator;
1297 struct arg_list *raw_keys;
1299 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1306 // toys/posix/split.c
1316 // toys/posix/strings.c
1318 struct strings_data {
1322 // toys/posix/tail.c
1328 int file_no, ffd, *files;
1337 // toys/posix/touch.c
1345 // toys/posix/ulimit.c
1347 struct ulimit_data {
1351 // toys/posix/uniq.c
1360 // toys/posix/uudecode.c
1362 struct uudecode_data {
1369 unsigned long totals[4];
1372 // toys/posix/xargs.c
1381 long entries, bytes;
1385 extern union global_union {
1386 struct getprop_data getprop;
1387 struct log_data log;
1388 struct hello_data hello;
1389 struct skeleton_data skeleton;
1390 struct hostname_data hostname;
1391 struct killall_data killall;
1392 struct md5sum_data md5sum;
1393 struct mknod_data mknod;
1394 struct mktemp_data mktemp;
1395 struct mount_data mount;
1396 struct passwd_data passwd;
1397 struct pidof_data pidof;
1398 struct seq_data seq;
1400 struct umount_data umount;
1401 struct ftpget_data ftpget;
1402 struct ifconfig_data ifconfig;
1403 struct microcom_data microcom;
1404 struct netcat_data netcat;
1405 struct netstat_data netstat;
1406 struct tunctl_data tunctl;
1407 struct acpi_data acpi;
1408 struct base64_data base64;
1409 struct blockdev_data blockdev;
1410 struct dos2unix_data dos2unix;
1411 struct fallocate_data fallocate;
1412 struct free_data free;
1413 struct hexedit_data hexedit;
1414 struct hwclock_data hwclock;
1415 struct ionice_data ionice;
1416 struct login_data login;
1417 struct losetup_data losetup;
1418 struct lspci_data lspci;
1419 struct makedevs_data makedevs;
1420 struct mix_data mix;
1421 struct mkpasswd_data mkpasswd;
1422 struct mkswap_data mkswap;
1423 struct modinfo_data modinfo;
1424 struct nsenter_data nsenter;
1425 struct oneit_data oneit;
1426 struct shred_data shred;
1427 struct stat_data stat;
1428 struct swapon_data swapon;
1429 struct switch_root_data switch_root;
1430 struct timeout_data timeout;
1431 struct truncate_data truncate;
1432 struct xxd_data xxd;
1433 struct arp_data arp;
1434 struct arping_data arping;
1435 struct bootchartd_data bootchartd;
1436 struct brctl_data brctl;
1437 struct chrt_data chrt;
1438 struct compress_data compress;
1439 struct crond_data crond;
1440 struct crontab_data crontab;
1442 struct dhcp_data dhcp;
1443 struct dhcp6_data dhcp6;
1444 struct dhcpd_data dhcpd;
1445 struct diff_data diff;
1446 struct dmesg_data dmesg;
1447 struct dumpleases_data dumpleases;
1448 struct expr_data expr;
1449 struct fdisk_data fdisk;
1450 struct fold_data fold;
1451 struct fsck_data fsck;
1452 struct getfattr_data getfattr;
1453 struct getty_data getty;
1454 struct groupadd_data groupadd;
1455 struct host_data host;
1456 struct iconv_data iconv;
1458 struct ipcrm_data ipcrm;
1459 struct ipcs_data ipcs;
1460 struct klogd_data klogd;
1461 struct last_data last;
1462 struct logger_data logger;
1463 struct lsof_data lsof;
1464 struct mke2fs_data mke2fs;
1465 struct modprobe_data modprobe;
1466 struct more_data more;
1467 struct openvt_data openvt;
1468 struct ping_data ping;
1469 struct route_data route;
1470 struct setfattr_data setfattr;
1472 struct sulogin_data sulogin;
1473 struct syslogd_data syslogd;
1474 struct tar_data tar;
1475 struct tcpsvd_data tcpsvd;
1476 struct telnet_data telnet;
1477 struct telnetd_data telnetd;
1478 struct tftp_data tftp;
1479 struct tftpd_data tftpd;
1481 struct traceroute_data traceroute;
1482 struct useradd_data useradd;
1484 struct watch_data watch;
1485 struct wget_data wget;
1486 struct chgrp_data chgrp;
1487 struct chmod_data chmod;
1488 struct cksum_data cksum;
1489 struct cmp_data cmp;
1491 struct cpio_data cpio;
1492 struct cut_data cut;
1493 struct date_data date;
1496 struct env_data env;
1497 struct expand_data expand;
1498 struct file_data file;
1499 struct find_data find;
1500 struct grep_data grep;
1501 struct head_data head;
1503 struct kill_data kill;
1505 struct mkdir_data mkdir;
1506 struct mkfifo_data mkfifo;
1507 struct nice_data nice;
1510 struct paste_data paste;
1511 struct patch_data patch;
1513 struct renice_data renice;
1514 struct sed_data sed;
1515 struct sort_data sort;
1516 struct split_data split;
1517 struct strings_data strings;
1518 struct tail_data tail;
1519 struct tee_data tee;
1520 struct touch_data touch;
1521 struct ulimit_data ulimit;
1522 struct uniq_data uniq;
1523 struct uudecode_data uudecode;
1525 struct xargs_data xargs;