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;
155 // toys/net/ifconfig.c
157 struct ifconfig_data {
161 // toys/net/microcom.c
163 struct microcom_data {
167 struct termios original_stdin_state, original_fd_state;
173 char *filename; // -f read from filename instead of network
174 long quit_delay; // -q Exit after EOF from stdin after # seconds.
175 char *source_address; // -s Bind to a specific source address.
176 long port; // -p Bind to a specific source port.
177 long idle; // -W Wait # seconds for more data
178 long wait; // -w Wait # seconds for a connection.
181 // toys/net/netstat.c
183 struct netstat_data {
184 struct num_cache *inodes;
197 int ac, bat, therm, cool;
201 // toys/other/base64.c
209 // toys/other/blockdev.c
211 struct blockdev_data {
221 // toys/other/dos2unix.c
223 struct dos2unix_data {
227 // toys/other/fallocate.c
229 struct fallocate_data {
238 unsigned long long units;
242 // toys/other/hexedit.c
244 struct hexedit_data {
247 int numlen, undo, undolen;
251 // toys/other/hwclock.c
253 struct hwclock_data {
259 // toys/other/ionice.c
267 // toys/other/login.c
273 int login_timeout, login_fail_timeout;
276 // toys/other/losetup.c
278 struct losetup_data {
288 // toys/other/lspci.c
297 // toys/other/makedevs.c
299 struct makedevs_data {
312 // toys/other/mkpasswd.c
314 struct mkpasswd_data {
320 // toys/other/mkswap.c
326 // toys/other/modinfo.c
328 struct modinfo_data {
336 // toys/other/nsenter.c
338 struct nsenter_data {
343 // toys/other/oneit.c
349 // toys/other/shred.c
368 char *file, *pattern;
372 // toys/other/swapon.c
378 // toys/other/switch_root.c
380 struct switch_root_data {
386 // toys/other/timeout.c
388 struct timeout_data {
395 struct itimerval itv;
398 // toys/other/truncate.c
400 struct truncate_data {
416 // toys/pending/arp.c
428 // toys/pending/arping.c
432 unsigned long time_out;
437 unsigned long start, end;
438 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
442 // toys/pending/bootchartd.c
444 struct bootchartd_data {
446 long smpl_period_usec;
453 // toys/pending/brctl.c
459 // toys/pending/compress.c
461 struct compress_data {
462 // Huffman codes: base offset and extra bits tables (length and distance)
463 char lenbits[29], distbits[30];
464 unsigned short lenbase[29], distbase[30];
465 void *fixdisthuff, *fixlithuff;
468 void (*crcfunc)(char *data, int len);
471 // Compressed data buffer
476 // Tables only used for deflation
477 unsigned short *hashhead, *hashchain;
480 // toys/pending/crond.c
488 time_t crontabs_dir_mtime;
492 // toys/pending/crontab.c
494 struct crontab_data {
504 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
505 struct timeval start;
509 unsigned char *buff, *bp;
511 unsigned long long offset;
515 // toys/pending/dhcp.c
524 struct arg_list *req_opt;
526 struct arg_list *pkt_opt;
532 // toys/pending/dhcp6.c
535 char *interface_name, *pidfile, *script;
536 long retry, timeout, errortimeout;
538 int length, state, request_length, sock, sock1, status, retval, retries;
540 uint8_t transction_id[3];
541 struct sockaddr_in6 input_socket6;
544 // toys/pending/dhcpd.c
551 // toys/pending/diff.c
556 struct arg_list *L_list;
558 int dir_num, size, is_binary, status, change, len[2];
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/gzip.c
641 // toys/pending/host.c
647 // toys/pending/iconv.c
659 char stats, singleline, flush, *filter_dev, gbuf[8192];
660 int sockfd, connected, from_ok, route_cmd;
661 int8_t addressfamily, is_addr;
664 // toys/pending/ipcrm.c
667 struct arg_list *qkey;
668 struct arg_list *qid;
669 struct arg_list *skey;
670 struct arg_list *sid;
671 struct arg_list *mkey;
672 struct arg_list *mid;
675 // toys/pending/ipcs.c
681 // toys/pending/klogd.c
689 // toys/pending/last.c
694 struct arg_list *list;
697 // toys/pending/logger.c
704 // toys/pending/lsof.c
709 struct stat *sought_files;
711 struct double_list *all_sockets;
712 struct double_list *files;
717 // toys/pending/mke2fs.c
720 // Command line arguments.
722 long bytes_per_inode;
723 long inodes; // Total inodes in filesystem.
724 long reserved_percent; // Integer precent of space to reserve for root.
725 char *gendir; // Where to read dirtree from.
728 struct dirtree *dt; // Tree of files to copy into the new filesystem.
729 unsigned treeblocks; // Blocks used by dt
730 unsigned treeinodes; // Inodes used by dt
732 unsigned blocks; // Total blocks in the filesystem.
733 unsigned freeblocks; // Free blocks in the filesystem.
734 unsigned inodespg; // Inodes per group
735 unsigned groups; // Total number of block groups.
736 unsigned blockbits; // Bits per block. (Also blocks per group.)
739 unsigned nextblock; // Next data block to allocate
740 unsigned nextgroup; // Next group we'll be allocating from
741 int fsfd; // File descriptor of filesystem (to output to).
743 struct ext2_superblock sb;
746 // toys/pending/modprobe.c
748 struct modprobe_data {
749 struct arg_list *dirs;
751 struct arg_list *probes;
752 struct arg_list *dbase[256];
758 // toys/pending/more.c
765 // toys/pending/openvt.c
768 unsigned long vt_num;
771 // toys/pending/ping.c
784 // toys/pending/route.c
790 // toys/pending/setfattr.c
792 struct setfattr_data {
804 // toys/pending/sulogin.c
806 struct sulogin_data {
808 struct termios crntio;
811 // toys/pending/syslogd.c
813 struct syslogd_data {
824 struct unsocks *lsocks; // list of listen sockets
825 struct logfile *lfiles; // list of write logfiles
829 // toys/pending/tar.c
834 struct arg_list *inc_file;
835 struct arg_list *exc_file;
837 struct arg_list *exc;
839 struct arg_list *inc, *pass;
840 void *inodes, *handle;
843 // toys/pending/tcpsvd.c
857 // toys/pending/telnet.c
867 struct termios def_term;
868 struct termios raw_term;
876 // toys/pending/telnetd.c
878 struct telnetd_data {
889 // toys/pending/tftp.c
896 struct sockaddr_storage inaddr;
900 // toys/pending/tftpd.c
912 short map[256]; //map of chars
916 // toys/pending/traceroute.c
918 struct traceroute_data {
925 struct arg_list *loose_source;
939 // toys/pending/useradd.c
941 struct useradd_data {
954 struct linestack *ls;
958 // toys/pending/watch.c
964 // toys/pending/wget.c
970 // toys/posix/chgrp.c
975 char *owner_name, *group_name;
979 // toys/posix/chmod.c
985 // toys/posix/cksum.c
988 unsigned crc_table[256];
1003 // install's options
1015 int (*callback)(struct dirtree *try);
1021 // toys/posix/cpio.c
1039 void (*do_cut)(int fd);
1042 // toys/posix/date.c
1055 struct arg_list *fstype;
1058 int column_widths[5];
1067 unsigned long depth, total;
1078 // toys/posix/expand.c
1080 struct expand_data {
1081 struct arg_list *tabs;
1083 unsigned tabcount, *tab;
1086 // toys/posix/file.c
1092 // toys/posix/find.c
1096 struct double_list *argdata;
1097 int topdir, xdev, depth;
1101 // toys/posix/grep.c
1113 char indelim, outdelim;
1117 // toys/posix/head.c
1130 // toys/posix/kill.c
1134 struct arg_list *olist;
1143 struct dirtree *files, *singledir;
1145 unsigned screen_width;
1150 // toys/posix/mkdir.c
1157 // toys/posix/mkfifo.c
1159 struct mkfifo_data {
1166 // toys/posix/nice.c
1182 // Count of consecutive blank lines for -l has to persist between files
1189 struct arg_list *output_base;
1196 unsigned types, leftover, star;
1197 char *buf; // Points to buffers[0] or buffers[1].
1198 char *bufs[2]; // Used to detect duplicate lines.
1202 // toys/posix/paste.c
1210 // toys/posix/patch.c
1217 struct double_list *current_hunk;
1218 long oldline, oldlen, newline, newlen;
1220 int context, state, filein, fileout, filepatch, hunknum;
1262 void *regexes, *snapshot;
1269 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1270 struct dirtree *threadparent;
1271 unsigned width, height;
1273 void *fields, *kfields;
1274 long long ticks, bits, time;
1275 int kcount, forcek, sortpos;
1276 int (*match_process)(long long *slot);
1277 void (*show_process)(void *tb);
1280 // toys/posix/renice.c
1282 struct renice_data {
1292 // processed pattern list
1293 struct double_list *pattern;
1295 char *nextline, *remember;
1296 void *restart, *lastregex;
1297 long nextlen, rememberlen, count;
1302 // toys/posix/sort.c
1305 char *key_separator;
1306 struct arg_list *raw_keys;
1308 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1315 // toys/posix/split.c
1325 // toys/posix/strings.c
1327 struct strings_data {
1331 // toys/posix/tail.c
1337 int file_no, ffd, *files;
1346 // toys/posix/touch.c
1354 // toys/posix/ulimit.c
1356 struct ulimit_data {
1360 // toys/posix/uniq.c
1369 // toys/posix/uudecode.c
1371 struct uudecode_data {
1378 unsigned long totals[4];
1381 // toys/posix/xargs.c
1390 long entries, bytes;
1394 extern union global_union {
1395 struct getprop_data getprop;
1396 struct log_data log;
1397 struct hello_data hello;
1398 struct skeleton_data skeleton;
1399 struct dmesg_data dmesg;
1400 struct hostname_data hostname;
1401 struct killall_data killall;
1402 struct md5sum_data md5sum;
1403 struct mknod_data mknod;
1404 struct mktemp_data mktemp;
1405 struct mount_data mount;
1406 struct passwd_data passwd;
1407 struct pidof_data pidof;
1408 struct seq_data seq;
1410 struct umount_data umount;
1411 struct ftpget_data ftpget;
1412 struct ifconfig_data ifconfig;
1413 struct microcom_data microcom;
1414 struct netcat_data netcat;
1415 struct netstat_data netstat;
1416 struct tunctl_data tunctl;
1417 struct acpi_data acpi;
1418 struct base64_data base64;
1419 struct blockdev_data blockdev;
1420 struct chrt_data chrt;
1421 struct dos2unix_data dos2unix;
1422 struct fallocate_data fallocate;
1423 struct free_data free;
1424 struct hexedit_data hexedit;
1425 struct hwclock_data hwclock;
1426 struct ionice_data ionice;
1427 struct login_data login;
1428 struct losetup_data losetup;
1429 struct lspci_data lspci;
1430 struct makedevs_data makedevs;
1431 struct mix_data mix;
1432 struct mkpasswd_data mkpasswd;
1433 struct mkswap_data mkswap;
1434 struct modinfo_data modinfo;
1435 struct nsenter_data nsenter;
1436 struct oneit_data oneit;
1437 struct shred_data shred;
1438 struct stat_data stat;
1439 struct swapon_data swapon;
1440 struct switch_root_data switch_root;
1441 struct timeout_data timeout;
1442 struct truncate_data truncate;
1443 struct xxd_data xxd;
1444 struct arp_data arp;
1445 struct arping_data arping;
1446 struct bootchartd_data bootchartd;
1447 struct brctl_data brctl;
1448 struct compress_data compress;
1449 struct crond_data crond;
1450 struct crontab_data crontab;
1452 struct dhcp_data dhcp;
1453 struct dhcp6_data dhcp6;
1454 struct dhcpd_data dhcpd;
1455 struct diff_data diff;
1456 struct dumpleases_data dumpleases;
1457 struct expr_data expr;
1458 struct fdisk_data fdisk;
1459 struct fold_data fold;
1460 struct fsck_data fsck;
1461 struct getfattr_data getfattr;
1462 struct getty_data getty;
1463 struct groupadd_data groupadd;
1464 struct gzip_data gzip;
1465 struct host_data host;
1466 struct iconv_data iconv;
1468 struct ipcrm_data ipcrm;
1469 struct ipcs_data ipcs;
1470 struct klogd_data klogd;
1471 struct last_data last;
1472 struct logger_data logger;
1473 struct lsof_data lsof;
1474 struct mke2fs_data mke2fs;
1475 struct modprobe_data modprobe;
1476 struct more_data more;
1477 struct openvt_data openvt;
1478 struct ping_data ping;
1479 struct route_data route;
1480 struct setfattr_data setfattr;
1482 struct sulogin_data sulogin;
1483 struct syslogd_data syslogd;
1484 struct tar_data tar;
1485 struct tcpsvd_data tcpsvd;
1486 struct telnet_data telnet;
1487 struct telnetd_data telnetd;
1488 struct tftp_data tftp;
1489 struct tftpd_data tftpd;
1491 struct traceroute_data traceroute;
1492 struct useradd_data useradd;
1494 struct watch_data watch;
1495 struct wget_data wget;
1496 struct chgrp_data chgrp;
1497 struct chmod_data chmod;
1498 struct cksum_data cksum;
1499 struct cmp_data cmp;
1501 struct cpio_data cpio;
1502 struct cut_data cut;
1503 struct date_data date;
1506 struct env_data env;
1507 struct expand_data expand;
1508 struct file_data file;
1509 struct find_data find;
1510 struct grep_data grep;
1511 struct head_data head;
1513 struct kill_data kill;
1515 struct mkdir_data mkdir;
1516 struct mkfifo_data mkfifo;
1517 struct nice_data nice;
1520 struct paste_data paste;
1521 struct patch_data patch;
1523 struct renice_data renice;
1524 struct sed_data sed;
1525 struct sort_data sort;
1526 struct split_data split;
1527 struct strings_data strings;
1528 struct tail_data tail;
1529 struct tee_data tee;
1530 struct touch_data touch;
1531 struct ulimit_data ulimit;
1532 struct uniq_data uniq;
1533 struct uudecode_data uudecode;
1535 struct xargs_data xargs;