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;
49 // toys/lsb/hostname.c
51 struct hostname_data {
73 // Crypto variables blanked after summing
99 struct arg_list *optlist;
142 // toys/net/ifconfig.c
144 struct ifconfig_data {
151 char *filename; // -f read from filename instead of network
152 long quit_delay; // -q Exit after EOF from stdin after # seconds.
153 char *source_address; // -s Bind to a specific source address.
154 long port; // -p Bind to a specific source port.
155 long idle; // -W Wait # seconds for more data
156 long wait; // -w Wait # seconds for a connection.
159 // toys/net/netstat.c
161 struct netstat_data {
162 struct num_cache *inodes;
175 int ac, bat, therm, cool;
179 // toys/other/base64.c
187 // toys/other/blockdev.c
189 struct blockdev_data {
193 // toys/other/dos2unix.c
195 struct dos2unix_data {
199 // toys/other/fallocate.c
201 struct fallocate_data {
210 unsigned long long units;
214 // toys/other/hexedit.c
216 struct hexedit_data {
219 int numlen, undo, undolen;
223 // toys/other/hwclock.c
225 struct hwclock_data {
231 // toys/other/ionice.c
239 // toys/other/login.c
245 int login_timeout, login_fail_timeout;
248 // toys/other/losetup.c
250 struct losetup_data {
260 // toys/other/lspci.c
269 // toys/other/makedevs.c
271 struct makedevs_data {
284 // toys/other/mkpasswd.c
286 struct mkpasswd_data {
292 // toys/other/mkswap.c
298 // toys/other/modinfo.c
300 struct modinfo_data {
308 // toys/other/nsenter.c
310 struct nsenter_data {
315 // toys/other/oneit.c
321 // toys/other/shred.c
340 char *file, *pattern;
344 // toys/other/swapon.c
350 // toys/other/switch_root.c
352 struct switch_root_data {
358 // toys/other/timeout.c
360 struct timeout_data {
367 struct itimerval itv;
370 // toys/other/truncate.c
372 struct truncate_data {
388 // toys/pending/arp.c
400 // toys/pending/arping.c
404 unsigned long time_out;
409 unsigned long start, end;
410 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
414 // toys/pending/bootchartd.c
416 struct bootchartd_data {
418 long smpl_period_usec;
425 // toys/pending/brctl.c
431 // toys/pending/chrt.c
437 // toys/pending/compress.c
439 struct compress_data {
440 // Huffman codes: base offset and extra bits tables (length and distance)
441 char lenbits[29], distbits[30];
442 unsigned short lenbase[29], distbase[30];
443 void *fixdisthuff, *fixlithuff;
446 void (*crcfunc)(char *data, int len);
449 // Compressed data buffer
454 // Tables only used for deflation
455 unsigned short *hashhead, *hashchain;
458 // toys/pending/crond.c
466 time_t crontabs_dir_mtime;
470 // toys/pending/crontab.c
472 struct crontab_data {
482 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
483 struct timeval start;
487 unsigned char *buff, *bp;
489 unsigned long long offset;
493 // toys/pending/dhcp.c
502 struct arg_list *req_opt;
504 struct arg_list *pkt_opt;
510 // toys/pending/dhcp6.c
513 char *interface_name, *pidfile, *script;
514 long retry, timeout, errortimeout;
516 int length, state, request_length, sock, sock1, status, retval, retries;
518 uint8_t transction_id[3];
519 struct sockaddr_in6 input_socket6;
522 // toys/pending/dhcpd.c
529 // toys/pending/diff.c
534 struct arg_list *L_list;
536 int dir_num, size, is_binary, status, change, len[2];
540 // toys/pending/dumpleases.c
542 struct dumpleases_data {
546 // toys/pending/expr.c
549 char **tok; // current token, not on the stack since recursive calls mutate it
554 // toys/pending/fdisk.c
563 // toys/pending/fold.c
569 // toys/pending/fsck.c
575 struct double_list *devices;
585 // toys/pending/ftpget.c
588 long port; // char *port;
595 char buf[sizeof(struct sockaddr_storage)];
598 // toys/pending/getfattr.c
600 struct getfattr_data {
604 // toys/pending/getty.c
616 struct termios termios;
620 // toys/pending/groupadd.c
622 struct groupadd_data {
626 // toys/pending/host.c
632 // toys/pending/iconv.c
644 char stats, singleline, flush, *filter_dev, gbuf[8192];
645 int sockfd, connected, from_ok, route_cmd;
646 int8_t addressfamily, is_addr;
649 // toys/pending/ipcrm.c
652 struct arg_list *qkey;
653 struct arg_list *qid;
654 struct arg_list *skey;
655 struct arg_list *sid;
656 struct arg_list *mkey;
657 struct arg_list *mid;
660 // toys/pending/ipcs.c
666 // toys/pending/klogd.c
674 // toys/pending/last.c
679 struct arg_list *list;
682 // toys/pending/logger.c
689 // toys/pending/lsof.c
694 struct stat *sought_files;
696 struct double_list *all_sockets;
697 struct double_list *files;
702 // toys/pending/mke2fs.c
705 // Command line arguments.
707 long bytes_per_inode;
708 long inodes; // Total inodes in filesystem.
709 long reserved_percent; // Integer precent of space to reserve for root.
710 char *gendir; // Where to read dirtree from.
713 struct dirtree *dt; // Tree of files to copy into the new filesystem.
714 unsigned treeblocks; // Blocks used by dt
715 unsigned treeinodes; // Inodes used by dt
717 unsigned blocks; // Total blocks in the filesystem.
718 unsigned freeblocks; // Free blocks in the filesystem.
719 unsigned inodespg; // Inodes per group
720 unsigned groups; // Total number of block groups.
721 unsigned blockbits; // Bits per block. (Also blocks per group.)
724 unsigned nextblock; // Next data block to allocate
725 unsigned nextgroup; // Next group we'll be allocating from
726 int fsfd; // File descriptor of filesystem (to output to).
728 struct ext2_superblock sb;
731 // toys/pending/modprobe.c
733 struct modprobe_data {
734 struct arg_list *probes;
735 struct arg_list *dbase[256];
739 void (*dbg)(char *format, ...);
742 // toys/pending/more.c
749 // toys/pending/openvt.c
752 unsigned long vt_num;
755 // toys/pending/ping.c
768 // toys/pending/route.c
774 // toys/pending/setfattr.c
776 struct setfattr_data {
788 // toys/pending/sulogin.c
790 struct sulogin_data {
792 struct termios crntio;
795 // toys/pending/syslogd.c
797 struct syslogd_data {
808 struct unsocks *lsocks; // list of listen sockets
809 struct logfile *lfiles; // list of write logfiles
813 // toys/pending/tar.c
818 struct arg_list *inc_file;
819 struct arg_list *exc_file;
821 struct arg_list *exc;
823 struct arg_list *inc, *pass;
824 void *inodes, *handle;
827 // toys/pending/tcpsvd.c
841 // toys/pending/telnet.c
851 struct termios def_term;
852 struct termios raw_term;
860 // toys/pending/telnetd.c
862 struct telnetd_data {
873 // toys/pending/tftp.c
880 struct sockaddr_storage inaddr;
884 // toys/pending/tftpd.c
896 short map[256]; //map of chars
900 // toys/pending/traceroute.c
902 struct traceroute_data {
909 struct arg_list *loose_source;
923 // toys/pending/useradd.c
925 struct useradd_data {
938 struct linestack *ls;
942 // toys/pending/watch.c
948 // toys/pending/wget.c
954 // toys/posix/chgrp.c
959 char *owner_name, *group_name;
963 // toys/posix/chmod.c
969 // toys/posix/cksum.c
972 unsigned crc_table[256];
999 int (*callback)(struct dirtree *try);
1005 // toys/posix/cpio.c
1023 void (*do_cut)(int fd);
1026 // toys/posix/date.c
1040 struct arg_list *fstype;
1043 int column_widths[5];
1052 unsigned long depth, total;
1063 // toys/posix/expand.c
1065 struct expand_data {
1066 struct arg_list *tabs;
1068 unsigned tabcount, *tab;
1071 // toys/posix/file.c
1077 // toys/posix/find.c
1081 struct double_list *argdata;
1082 int topdir, xdev, depth;
1086 // toys/posix/grep.c
1096 char indelim, outdelim;
1099 // toys/posix/head.c
1112 // toys/posix/kill.c
1116 struct arg_list *olist;
1124 struct dirtree *files, *singledir;
1126 unsigned screen_width;
1131 // toys/posix/mkdir.c
1138 // toys/posix/mkfifo.c
1140 struct mkfifo_data {
1147 // toys/posix/nice.c
1163 // Count of consecutive blank lines for -l has to persist between files
1170 struct arg_list *output_base;
1177 unsigned types, leftover, star;
1178 char *buf; // Points to buffers[0] or buffers[1].
1179 char *bufs[2]; // Used to detect duplicate lines.
1183 // toys/posix/paste.c
1189 // toys/posix/patch.c
1196 struct double_list *current_hunk;
1197 long oldline, oldlen, newline, newlen;
1199 int context, state, filein, fileout, filepatch, hunknum;
1241 void *regexes, *snapshot;
1248 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1249 struct dirtree *threadparent;
1250 unsigned width, height;
1252 void *fields, *kfields;
1253 long long ticks, bits, time;
1254 int kcount, forcek, sortpos;
1255 int (*match_process)(long long *slot);
1256 void (*show_process)(void *tb);
1259 // toys/posix/renice.c
1261 struct renice_data {
1271 // processed pattern list
1272 struct double_list *pattern;
1274 char *nextline, *remember;
1275 void *restart, *lastregex;
1276 long nextlen, rememberlen, count;
1281 // toys/posix/sort.c
1284 char *key_separator;
1285 struct arg_list *raw_keys;
1287 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1294 // toys/posix/split.c
1304 // toys/posix/strings.c
1306 struct strings_data {
1310 // toys/posix/tail.c
1316 int file_no, ffd, *files;
1325 // toys/posix/touch.c
1333 // toys/posix/ulimit.c
1335 struct ulimit_data {
1339 // toys/posix/uniq.c
1348 // toys/posix/uudecode.c
1350 struct uudecode_data {
1357 unsigned long totals[4];
1360 // toys/posix/xargs.c
1369 long entries, bytes;
1373 extern union global_union {
1374 struct getprop_data getprop;
1375 struct log_data log;
1376 struct hello_data hello;
1377 struct skeleton_data skeleton;
1378 struct dmesg_data dmesg;
1379 struct hostname_data hostname;
1380 struct killall_data killall;
1381 struct md5sum_data md5sum;
1382 struct mknod_data mknod;
1383 struct mktemp_data mktemp;
1384 struct mount_data mount;
1385 struct passwd_data passwd;
1386 struct pidof_data pidof;
1387 struct seq_data seq;
1389 struct umount_data umount;
1390 struct ifconfig_data ifconfig;
1391 struct netcat_data netcat;
1392 struct netstat_data netstat;
1393 struct tunctl_data tunctl;
1394 struct acpi_data acpi;
1395 struct base64_data base64;
1396 struct blockdev_data blockdev;
1397 struct dos2unix_data dos2unix;
1398 struct fallocate_data fallocate;
1399 struct free_data free;
1400 struct hexedit_data hexedit;
1401 struct hwclock_data hwclock;
1402 struct ionice_data ionice;
1403 struct login_data login;
1404 struct losetup_data losetup;
1405 struct lspci_data lspci;
1406 struct makedevs_data makedevs;
1407 struct mix_data mix;
1408 struct mkpasswd_data mkpasswd;
1409 struct mkswap_data mkswap;
1410 struct modinfo_data modinfo;
1411 struct nsenter_data nsenter;
1412 struct oneit_data oneit;
1413 struct shred_data shred;
1414 struct stat_data stat;
1415 struct swapon_data swapon;
1416 struct switch_root_data switch_root;
1417 struct timeout_data timeout;
1418 struct truncate_data truncate;
1419 struct xxd_data xxd;
1420 struct arp_data arp;
1421 struct arping_data arping;
1422 struct bootchartd_data bootchartd;
1423 struct brctl_data brctl;
1424 struct chrt_data chrt;
1425 struct compress_data compress;
1426 struct crond_data crond;
1427 struct crontab_data crontab;
1429 struct dhcp_data dhcp;
1430 struct dhcp6_data dhcp6;
1431 struct dhcpd_data dhcpd;
1432 struct diff_data diff;
1433 struct dumpleases_data dumpleases;
1434 struct expr_data expr;
1435 struct fdisk_data fdisk;
1436 struct fold_data fold;
1437 struct fsck_data fsck;
1438 struct ftpget_data ftpget;
1439 struct getfattr_data getfattr;
1440 struct getty_data getty;
1441 struct groupadd_data groupadd;
1442 struct host_data host;
1443 struct iconv_data iconv;
1445 struct ipcrm_data ipcrm;
1446 struct ipcs_data ipcs;
1447 struct klogd_data klogd;
1448 struct last_data last;
1449 struct logger_data logger;
1450 struct lsof_data lsof;
1451 struct mke2fs_data mke2fs;
1452 struct modprobe_data modprobe;
1453 struct more_data more;
1454 struct openvt_data openvt;
1455 struct ping_data ping;
1456 struct route_data route;
1457 struct setfattr_data setfattr;
1459 struct sulogin_data sulogin;
1460 struct syslogd_data syslogd;
1461 struct tar_data tar;
1462 struct tcpsvd_data tcpsvd;
1463 struct telnet_data telnet;
1464 struct telnetd_data telnetd;
1465 struct tftp_data tftp;
1466 struct tftpd_data tftpd;
1468 struct traceroute_data traceroute;
1469 struct useradd_data useradd;
1471 struct watch_data watch;
1472 struct wget_data wget;
1473 struct chgrp_data chgrp;
1474 struct chmod_data chmod;
1475 struct cksum_data cksum;
1476 struct cmp_data cmp;
1478 struct cpio_data cpio;
1479 struct cut_data cut;
1480 struct date_data date;
1483 struct env_data env;
1484 struct expand_data expand;
1485 struct file_data file;
1486 struct find_data find;
1487 struct grep_data grep;
1488 struct head_data head;
1490 struct kill_data kill;
1492 struct mkdir_data mkdir;
1493 struct mkfifo_data mkfifo;
1494 struct nice_data nice;
1497 struct paste_data paste;
1498 struct patch_data patch;
1500 struct renice_data renice;
1501 struct sed_data sed;
1502 struct sort_data sort;
1503 struct split_data split;
1504 struct strings_data strings;
1505 struct tail_data tail;
1506 struct tee_data tee;
1507 struct touch_data touch;
1508 struct ulimit_data ulimit;
1509 struct uniq_data uniq;
1510 struct uudecode_data uudecode;
1512 struct xargs_data xargs;