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
1131 // toys/posix/kill.c
1135 struct arg_list *olist;
1144 struct dirtree *files, *singledir;
1146 unsigned screen_width;
1151 // toys/posix/mkdir.c
1158 // toys/posix/mkfifo.c
1160 struct mkfifo_data {
1167 // toys/posix/nice.c
1183 // Count of consecutive blank lines for -l has to persist between files
1190 struct arg_list *output_base;
1197 unsigned types, leftover, star;
1198 char *buf; // Points to buffers[0] or buffers[1].
1199 char *bufs[2]; // Used to detect duplicate lines.
1203 // toys/posix/paste.c
1211 // toys/posix/patch.c
1218 struct double_list *current_hunk;
1219 long oldline, oldlen, newline, newlen;
1221 int context, state, filein, fileout, filepatch, hunknum;
1263 void *regexes, *snapshot;
1270 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1271 struct dirtree *threadparent;
1272 unsigned width, height;
1274 void *fields, *kfields;
1275 long long ticks, bits, time;
1276 int kcount, forcek, sortpos;
1277 int (*match_process)(long long *slot);
1278 void (*show_process)(void *tb);
1281 // toys/posix/renice.c
1283 struct renice_data {
1293 // processed pattern list
1294 struct double_list *pattern;
1296 char *nextline, *remember;
1297 void *restart, *lastregex;
1298 long nextlen, rememberlen, count;
1303 // toys/posix/sort.c
1306 char *key_separator;
1307 struct arg_list *raw_keys;
1309 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1316 // toys/posix/split.c
1326 // toys/posix/strings.c
1328 struct strings_data {
1333 // toys/posix/tail.c
1339 int file_no, ffd, *files;
1348 // toys/posix/touch.c
1356 // toys/posix/ulimit.c
1358 struct ulimit_data {
1362 // toys/posix/uniq.c
1371 // toys/posix/uudecode.c
1373 struct uudecode_data {
1380 unsigned long totals[4];
1383 // toys/posix/xargs.c
1392 long entries, bytes;
1396 extern union global_union {
1397 struct getprop_data getprop;
1398 struct log_data log;
1399 struct hello_data hello;
1400 struct skeleton_data skeleton;
1401 struct dmesg_data dmesg;
1402 struct hostname_data hostname;
1403 struct killall_data killall;
1404 struct md5sum_data md5sum;
1405 struct mknod_data mknod;
1406 struct mktemp_data mktemp;
1407 struct mount_data mount;
1408 struct passwd_data passwd;
1409 struct pidof_data pidof;
1410 struct seq_data seq;
1412 struct umount_data umount;
1413 struct ftpget_data ftpget;
1414 struct ifconfig_data ifconfig;
1415 struct microcom_data microcom;
1416 struct netcat_data netcat;
1417 struct netstat_data netstat;
1418 struct tunctl_data tunctl;
1419 struct acpi_data acpi;
1420 struct base64_data base64;
1421 struct blockdev_data blockdev;
1422 struct chrt_data chrt;
1423 struct dos2unix_data dos2unix;
1424 struct fallocate_data fallocate;
1425 struct free_data free;
1426 struct hexedit_data hexedit;
1427 struct hwclock_data hwclock;
1428 struct ionice_data ionice;
1429 struct login_data login;
1430 struct losetup_data losetup;
1431 struct lspci_data lspci;
1432 struct makedevs_data makedevs;
1433 struct mix_data mix;
1434 struct mkpasswd_data mkpasswd;
1435 struct mkswap_data mkswap;
1436 struct modinfo_data modinfo;
1437 struct nsenter_data nsenter;
1438 struct oneit_data oneit;
1439 struct shred_data shred;
1440 struct stat_data stat;
1441 struct swapon_data swapon;
1442 struct switch_root_data switch_root;
1443 struct timeout_data timeout;
1444 struct truncate_data truncate;
1445 struct xxd_data xxd;
1446 struct arp_data arp;
1447 struct arping_data arping;
1448 struct bootchartd_data bootchartd;
1449 struct brctl_data brctl;
1450 struct compress_data compress;
1451 struct crond_data crond;
1452 struct crontab_data crontab;
1454 struct dhcp_data dhcp;
1455 struct dhcp6_data dhcp6;
1456 struct dhcpd_data dhcpd;
1457 struct diff_data diff;
1458 struct dumpleases_data dumpleases;
1459 struct expr_data expr;
1460 struct fdisk_data fdisk;
1461 struct fold_data fold;
1462 struct fsck_data fsck;
1463 struct getfattr_data getfattr;
1464 struct getty_data getty;
1465 struct groupadd_data groupadd;
1466 struct gzip_data gzip;
1467 struct host_data host;
1468 struct iconv_data iconv;
1470 struct ipcrm_data ipcrm;
1471 struct ipcs_data ipcs;
1472 struct klogd_data klogd;
1473 struct last_data last;
1474 struct logger_data logger;
1475 struct lsof_data lsof;
1476 struct mke2fs_data mke2fs;
1477 struct modprobe_data modprobe;
1478 struct more_data more;
1479 struct openvt_data openvt;
1480 struct ping_data ping;
1481 struct route_data route;
1482 struct setfattr_data setfattr;
1484 struct sulogin_data sulogin;
1485 struct syslogd_data syslogd;
1486 struct tar_data tar;
1487 struct tcpsvd_data tcpsvd;
1488 struct telnet_data telnet;
1489 struct telnetd_data telnetd;
1490 struct tftp_data tftp;
1491 struct tftpd_data tftpd;
1493 struct traceroute_data traceroute;
1494 struct useradd_data useradd;
1496 struct watch_data watch;
1497 struct wget_data wget;
1498 struct chgrp_data chgrp;
1499 struct chmod_data chmod;
1500 struct cksum_data cksum;
1501 struct cmp_data cmp;
1503 struct cpio_data cpio;
1504 struct cut_data cut;
1505 struct date_data date;
1508 struct env_data env;
1509 struct expand_data expand;
1510 struct file_data file;
1511 struct find_data find;
1512 struct grep_data grep;
1513 struct head_data head;
1515 struct kill_data kill;
1517 struct mkdir_data mkdir;
1518 struct mkfifo_data mkfifo;
1519 struct nice_data nice;
1522 struct paste_data paste;
1523 struct patch_data patch;
1525 struct renice_data renice;
1526 struct sed_data sed;
1527 struct sort_data sort;
1528 struct split_data split;
1529 struct strings_data strings;
1530 struct tail_data tail;
1531 struct tee_data tee;
1532 struct touch_data touch;
1533 struct ulimit_data ulimit;
1534 struct uniq_data uniq;
1535 struct uudecode_data uudecode;
1537 struct xargs_data xargs;