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 {
160 // toys/net/microcom.c
162 struct microcom_data {
166 struct termios original_stdin_state, original_fd_state;
172 char *filename; // -f read from filename instead of network
173 long quit_delay; // -q Exit after EOF from stdin after # seconds.
174 char *source_address; // -s Bind to a specific source address.
175 long port; // -p Bind to a specific source port.
176 long idle; // -W Wait # seconds for more data
177 long wait; // -w Wait # seconds for a connection.
180 // toys/net/netstat.c
182 struct netstat_data {
183 struct num_cache *inodes;
196 int ac, bat, therm, cool;
200 // toys/other/base64.c
208 // toys/other/blockdev.c
210 struct blockdev_data {
214 // toys/other/dos2unix.c
216 struct dos2unix_data {
220 // toys/other/fallocate.c
222 struct fallocate_data {
231 unsigned long long units;
235 // toys/other/hexedit.c
237 struct hexedit_data {
240 int numlen, undo, undolen;
244 // toys/other/hwclock.c
246 struct hwclock_data {
252 // toys/other/ionice.c
260 // toys/other/login.c
266 int login_timeout, login_fail_timeout;
269 // toys/other/losetup.c
271 struct losetup_data {
281 // toys/other/lspci.c
290 // toys/other/makedevs.c
292 struct makedevs_data {
305 // toys/other/mkpasswd.c
307 struct mkpasswd_data {
313 // toys/other/mkswap.c
319 // toys/other/modinfo.c
321 struct modinfo_data {
329 // toys/other/nsenter.c
331 struct nsenter_data {
336 // toys/other/oneit.c
342 // toys/other/shred.c
361 char *file, *pattern;
365 // toys/other/swapon.c
371 // toys/other/switch_root.c
373 struct switch_root_data {
379 // toys/other/timeout.c
381 struct timeout_data {
388 struct itimerval itv;
391 // toys/other/truncate.c
393 struct truncate_data {
409 // toys/pending/arp.c
421 // toys/pending/arping.c
425 unsigned long time_out;
430 unsigned long start, end;
431 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
435 // toys/pending/bootchartd.c
437 struct bootchartd_data {
439 long smpl_period_usec;
446 // toys/pending/brctl.c
452 // toys/pending/chrt.c
458 // toys/pending/compress.c
460 struct compress_data {
461 // Huffman codes: base offset and extra bits tables (length and distance)
462 char lenbits[29], distbits[30];
463 unsigned short lenbase[29], distbase[30];
464 void *fixdisthuff, *fixlithuff;
467 void (*crcfunc)(char *data, int len);
470 // Compressed data buffer
475 // Tables only used for deflation
476 unsigned short *hashhead, *hashchain;
479 // toys/pending/crond.c
487 time_t crontabs_dir_mtime;
491 // toys/pending/crontab.c
493 struct crontab_data {
503 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
504 struct timeval start;
508 unsigned char *buff, *bp;
510 unsigned long long offset;
514 // toys/pending/dhcp.c
523 struct arg_list *req_opt;
525 struct arg_list *pkt_opt;
531 // toys/pending/dhcp6.c
534 char *interface_name, *pidfile, *script;
535 long retry, timeout, errortimeout;
537 int length, state, request_length, sock, sock1, status, retval, retries;
539 uint8_t transction_id[3];
540 struct sockaddr_in6 input_socket6;
543 // toys/pending/dhcpd.c
550 // toys/pending/diff.c
555 struct arg_list *L_list;
557 int dir_num, size, is_binary, status, change, len[2];
561 // toys/pending/dumpleases.c
563 struct dumpleases_data {
567 // toys/pending/expr.c
570 char **tok; // current token, not on the stack since recursive calls mutate it
575 // toys/pending/fdisk.c
584 // toys/pending/fold.c
590 // toys/pending/fsck.c
596 struct double_list *devices;
606 // toys/pending/getfattr.c
608 struct getfattr_data {
612 // toys/pending/getty.c
624 struct termios termios;
628 // toys/pending/groupadd.c
630 struct groupadd_data {
634 // toys/pending/host.c
640 // toys/pending/iconv.c
652 char stats, singleline, flush, *filter_dev, gbuf[8192];
653 int sockfd, connected, from_ok, route_cmd;
654 int8_t addressfamily, is_addr;
657 // toys/pending/ipcrm.c
660 struct arg_list *qkey;
661 struct arg_list *qid;
662 struct arg_list *skey;
663 struct arg_list *sid;
664 struct arg_list *mkey;
665 struct arg_list *mid;
668 // toys/pending/ipcs.c
674 // toys/pending/klogd.c
682 // toys/pending/last.c
687 struct arg_list *list;
690 // toys/pending/logger.c
697 // toys/pending/lsof.c
702 struct stat *sought_files;
704 struct double_list *all_sockets;
705 struct double_list *files;
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 *dirs;
744 struct arg_list *probes;
745 struct arg_list *dbase[256];
751 // toys/pending/more.c
758 // toys/pending/openvt.c
761 unsigned long vt_num;
764 // toys/pending/ping.c
777 // toys/pending/route.c
783 // toys/pending/setfattr.c
785 struct setfattr_data {
797 // toys/pending/sulogin.c
799 struct sulogin_data {
801 struct termios crntio;
804 // toys/pending/syslogd.c
806 struct syslogd_data {
817 struct unsocks *lsocks; // list of listen sockets
818 struct logfile *lfiles; // list of write logfiles
822 // toys/pending/tar.c
827 struct arg_list *inc_file;
828 struct arg_list *exc_file;
830 struct arg_list *exc;
832 struct arg_list *inc, *pass;
833 void *inodes, *handle;
836 // toys/pending/tcpsvd.c
850 // toys/pending/telnet.c
860 struct termios def_term;
861 struct termios raw_term;
869 // toys/pending/telnetd.c
871 struct telnetd_data {
882 // toys/pending/tftp.c
889 struct sockaddr_storage inaddr;
893 // toys/pending/tftpd.c
905 short map[256]; //map of chars
909 // toys/pending/traceroute.c
911 struct traceroute_data {
918 struct arg_list *loose_source;
932 // toys/pending/useradd.c
934 struct useradd_data {
947 struct linestack *ls;
951 // toys/pending/watch.c
957 // toys/pending/wget.c
963 // toys/posix/chgrp.c
968 char *owner_name, *group_name;
972 // toys/posix/chmod.c
978 // toys/posix/cksum.c
981 unsigned crc_table[256];
1008 int (*callback)(struct dirtree *try);
1014 // toys/posix/cpio.c
1032 void (*do_cut)(int fd);
1035 // 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;
1133 struct dirtree *files, *singledir;
1135 unsigned screen_width;
1140 // toys/posix/mkdir.c
1147 // toys/posix/mkfifo.c
1149 struct mkfifo_data {
1156 // toys/posix/nice.c
1172 // Count of consecutive blank lines for -l has to persist between files
1179 struct arg_list *output_base;
1186 unsigned types, leftover, star;
1187 char *buf; // Points to buffers[0] or buffers[1].
1188 char *bufs[2]; // Used to detect duplicate lines.
1192 // toys/posix/paste.c
1198 // toys/posix/patch.c
1205 struct double_list *current_hunk;
1206 long oldline, oldlen, newline, newlen;
1208 int context, state, filein, fileout, filepatch, hunknum;
1250 void *regexes, *snapshot;
1257 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1258 struct dirtree *threadparent;
1259 unsigned width, height;
1261 void *fields, *kfields;
1262 long long ticks, bits, time;
1263 int kcount, forcek, sortpos;
1264 int (*match_process)(long long *slot);
1265 void (*show_process)(void *tb);
1268 // toys/posix/renice.c
1270 struct renice_data {
1280 // processed pattern list
1281 struct double_list *pattern;
1283 char *nextline, *remember;
1284 void *restart, *lastregex;
1285 long nextlen, rememberlen, count;
1290 // toys/posix/sort.c
1293 char *key_separator;
1294 struct arg_list *raw_keys;
1296 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1303 // toys/posix/split.c
1313 // toys/posix/strings.c
1315 struct strings_data {
1319 // toys/posix/tail.c
1325 int file_no, ffd, *files;
1334 // toys/posix/touch.c
1342 // toys/posix/ulimit.c
1344 struct ulimit_data {
1348 // toys/posix/uniq.c
1357 // toys/posix/uudecode.c
1359 struct uudecode_data {
1366 unsigned long totals[4];
1369 // toys/posix/xargs.c
1378 long entries, bytes;
1382 extern union global_union {
1383 struct getprop_data getprop;
1384 struct log_data log;
1385 struct hello_data hello;
1386 struct skeleton_data skeleton;
1387 struct dmesg_data dmesg;
1388 struct hostname_data hostname;
1389 struct killall_data killall;
1390 struct md5sum_data md5sum;
1391 struct mknod_data mknod;
1392 struct mktemp_data mktemp;
1393 struct mount_data mount;
1394 struct passwd_data passwd;
1395 struct pidof_data pidof;
1396 struct seq_data seq;
1398 struct umount_data umount;
1399 struct ftpget_data ftpget;
1400 struct ifconfig_data ifconfig;
1401 struct microcom_data microcom;
1402 struct netcat_data netcat;
1403 struct netstat_data netstat;
1404 struct tunctl_data tunctl;
1405 struct acpi_data acpi;
1406 struct base64_data base64;
1407 struct blockdev_data blockdev;
1408 struct dos2unix_data dos2unix;
1409 struct fallocate_data fallocate;
1410 struct free_data free;
1411 struct hexedit_data hexedit;
1412 struct hwclock_data hwclock;
1413 struct ionice_data ionice;
1414 struct login_data login;
1415 struct losetup_data losetup;
1416 struct lspci_data lspci;
1417 struct makedevs_data makedevs;
1418 struct mix_data mix;
1419 struct mkpasswd_data mkpasswd;
1420 struct mkswap_data mkswap;
1421 struct modinfo_data modinfo;
1422 struct nsenter_data nsenter;
1423 struct oneit_data oneit;
1424 struct shred_data shred;
1425 struct stat_data stat;
1426 struct swapon_data swapon;
1427 struct switch_root_data switch_root;
1428 struct timeout_data timeout;
1429 struct truncate_data truncate;
1430 struct xxd_data xxd;
1431 struct arp_data arp;
1432 struct arping_data arping;
1433 struct bootchartd_data bootchartd;
1434 struct brctl_data brctl;
1435 struct chrt_data chrt;
1436 struct compress_data compress;
1437 struct crond_data crond;
1438 struct crontab_data crontab;
1440 struct dhcp_data dhcp;
1441 struct dhcp6_data dhcp6;
1442 struct dhcpd_data dhcpd;
1443 struct diff_data diff;
1444 struct dumpleases_data dumpleases;
1445 struct expr_data expr;
1446 struct fdisk_data fdisk;
1447 struct fold_data fold;
1448 struct fsck_data fsck;
1449 struct getfattr_data getfattr;
1450 struct getty_data getty;
1451 struct groupadd_data groupadd;
1452 struct host_data host;
1453 struct iconv_data iconv;
1455 struct ipcrm_data ipcrm;
1456 struct ipcs_data ipcs;
1457 struct klogd_data klogd;
1458 struct last_data last;
1459 struct logger_data logger;
1460 struct lsof_data lsof;
1461 struct mke2fs_data mke2fs;
1462 struct modprobe_data modprobe;
1463 struct more_data more;
1464 struct openvt_data openvt;
1465 struct ping_data ping;
1466 struct route_data route;
1467 struct setfattr_data setfattr;
1469 struct sulogin_data sulogin;
1470 struct syslogd_data syslogd;
1471 struct tar_data tar;
1472 struct tcpsvd_data tcpsvd;
1473 struct telnet_data telnet;
1474 struct telnetd_data telnetd;
1475 struct tftp_data tftp;
1476 struct tftpd_data tftpd;
1478 struct traceroute_data traceroute;
1479 struct useradd_data useradd;
1481 struct watch_data watch;
1482 struct wget_data wget;
1483 struct chgrp_data chgrp;
1484 struct chmod_data chmod;
1485 struct cksum_data cksum;
1486 struct cmp_data cmp;
1488 struct cpio_data cpio;
1489 struct cut_data cut;
1490 struct date_data date;
1493 struct env_data env;
1494 struct expand_data expand;
1495 struct file_data file;
1496 struct find_data find;
1497 struct grep_data grep;
1498 struct head_data head;
1500 struct kill_data kill;
1502 struct mkdir_data mkdir;
1503 struct mkfifo_data mkfifo;
1504 struct nice_data nice;
1507 struct paste_data paste;
1508 struct patch_data patch;
1510 struct renice_data renice;
1511 struct sed_data sed;
1512 struct sort_data sort;
1513 struct split_data split;
1514 struct strings_data strings;
1515 struct tail_data tail;
1516 struct tee_data tee;
1517 struct touch_data touch;
1518 struct ulimit_data ulimit;
1519 struct uniq_data uniq;
1520 struct uudecode_data uudecode;
1522 struct xargs_data xargs;