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 {
209 unsigned long long units;
213 // toys/other/hexedit.c
215 struct hexedit_data {
218 int numlen, undo, undolen;
222 // toys/other/hwclock.c
224 struct hwclock_data {
230 // toys/other/ionice.c
238 // toys/other/login.c
244 int login_timeout, login_fail_timeout;
247 // toys/other/losetup.c
249 struct losetup_data {
259 // toys/other/lspci.c
268 // toys/other/makedevs.c
270 struct makedevs_data {
283 // toys/other/mkpasswd.c
285 struct mkpasswd_data {
291 // toys/other/mkswap.c
297 // toys/other/modinfo.c
299 struct modinfo_data {
307 // toys/other/nsenter.c
309 struct nsenter_data {
314 // toys/other/oneit.c
320 // toys/other/shred.c
339 char *file, *pattern;
343 // toys/other/swapon.c
349 // toys/other/switch_root.c
351 struct switch_root_data {
357 // toys/other/timeout.c
359 struct timeout_data {
366 struct itimerval itv;
369 // toys/other/truncate.c
371 struct truncate_data {
387 // toys/pending/arp.c
399 // toys/pending/arping.c
403 unsigned long time_out;
408 unsigned long start, end;
409 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
413 // toys/pending/bootchartd.c
415 struct bootchartd_data {
417 long smpl_period_usec;
424 // toys/pending/brctl.c
430 // toys/pending/chrt.c
436 // toys/pending/compress.c
438 struct compress_data {
439 // Huffman codes: base offset and extra bits tables (length and distance)
440 char lenbits[29], distbits[30];
441 unsigned short lenbase[29], distbase[30];
442 void *fixdisthuff, *fixlithuff;
445 void (*crcfunc)(char *data, int len);
448 // Compressed data buffer
453 // Tables only used for deflation
454 unsigned short *hashhead, *hashchain;
457 // toys/pending/crond.c
465 time_t crontabs_dir_mtime;
469 // toys/pending/crontab.c
471 struct crontab_data {
481 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
482 struct timeval start;
486 unsigned char *buff, *bp;
488 unsigned long long offset;
492 // toys/pending/dhcp.c
501 struct arg_list *req_opt;
503 struct arg_list *pkt_opt;
509 // toys/pending/dhcp6.c
512 char *interface_name, *pidfile, *script;
513 long retry, timeout, errortimeout;
515 int length, state, request_length, sock, sock1, status, retval, retries;
517 uint8_t transction_id[3];
518 struct sockaddr_in6 input_socket6;
521 // toys/pending/dhcpd.c
528 // toys/pending/diff.c
533 struct arg_list *L_list;
535 int dir_num, size, is_binary, status, change, len[2];
539 // toys/pending/dumpleases.c
541 struct dumpleases_data {
545 // toys/pending/expr.c
548 char **tok; // current token, not on the stack since recursive calls mutate it
553 // toys/pending/fdisk.c
562 // toys/pending/fold.c
568 // toys/pending/fsck.c
574 struct double_list *devices;
584 // toys/pending/ftpget.c
587 long port; // char *port;
594 char buf[sizeof(struct sockaddr_storage)];
597 // toys/pending/getfattr.c
599 struct getfattr_data {
603 // toys/pending/getty.c
615 struct termios termios;
619 // toys/pending/groupadd.c
621 struct groupadd_data {
625 // toys/pending/host.c
631 // toys/pending/iconv.c
643 char stats, singleline, flush, *filter_dev, gbuf[8192];
644 int sockfd, connected, from_ok, route_cmd;
645 int8_t addressfamily, is_addr;
648 // toys/pending/ipcrm.c
651 struct arg_list *qkey;
652 struct arg_list *qid;
653 struct arg_list *skey;
654 struct arg_list *sid;
655 struct arg_list *mkey;
656 struct arg_list *mid;
659 // toys/pending/ipcs.c
665 // toys/pending/klogd.c
673 // toys/pending/last.c
678 struct arg_list *list;
681 // toys/pending/logger.c
688 // toys/pending/lsof.c
693 struct stat *sought_files;
695 struct double_list *all_sockets;
696 struct double_list *files;
701 // toys/pending/mke2fs.c
704 // Command line arguments.
706 long bytes_per_inode;
707 long inodes; // Total inodes in filesystem.
708 long reserved_percent; // Integer precent of space to reserve for root.
709 char *gendir; // Where to read dirtree from.
712 struct dirtree *dt; // Tree of files to copy into the new filesystem.
713 unsigned treeblocks; // Blocks used by dt
714 unsigned treeinodes; // Inodes used by dt
716 unsigned blocks; // Total blocks in the filesystem.
717 unsigned freeblocks; // Free blocks in the filesystem.
718 unsigned inodespg; // Inodes per group
719 unsigned groups; // Total number of block groups.
720 unsigned blockbits; // Bits per block. (Also blocks per group.)
723 unsigned nextblock; // Next data block to allocate
724 unsigned nextgroup; // Next group we'll be allocating from
725 int fsfd; // File descriptor of filesystem (to output to).
727 struct ext2_superblock sb;
730 // toys/pending/modprobe.c
732 struct modprobe_data {
733 struct arg_list *probes;
734 struct arg_list *dbase[256];
738 void (*dbg)(char *format, ...);
741 // toys/pending/more.c
748 // toys/pending/openvt.c
751 unsigned long vt_num;
754 // toys/pending/ping.c
767 // toys/pending/route.c
773 // toys/pending/setfattr.c
775 struct setfattr_data {
787 // toys/pending/sulogin.c
789 struct sulogin_data {
791 struct termios crntio;
794 // toys/pending/syslogd.c
796 struct syslogd_data {
807 struct unsocks *lsocks; // list of listen sockets
808 struct logfile *lfiles; // list of write logfiles
812 // toys/pending/tar.c
817 struct arg_list *inc_file;
818 struct arg_list *exc_file;
820 struct arg_list *exc;
822 struct arg_list *inc, *pass;
823 void *inodes, *handle;
826 // toys/pending/tcpsvd.c
840 // toys/pending/telnet.c
850 struct termios def_term;
851 struct termios raw_term;
859 // toys/pending/telnetd.c
861 struct telnetd_data {
872 // toys/pending/tftp.c
879 struct sockaddr_storage inaddr;
883 // toys/pending/tftpd.c
895 short map[256]; //map of chars
899 // toys/pending/traceroute.c
901 struct traceroute_data {
908 struct arg_list *loose_source;
922 // toys/pending/useradd.c
924 struct useradd_data {
937 struct linestack *ls;
941 // toys/pending/watch.c
947 // toys/pending/wget.c
953 // toys/posix/chgrp.c
958 char *owner_name, *group_name;
962 // toys/posix/chmod.c
968 // toys/posix/cksum.c
971 unsigned crc_table[256];
998 int (*callback)(struct dirtree *try);
1004 // toys/posix/cpio.c
1022 void (*do_cut)(int fd);
1025 // toys/posix/date.c
1039 struct arg_list *fstype;
1042 int column_widths[5];
1051 unsigned long depth, total;
1062 // toys/posix/expand.c
1064 struct expand_data {
1065 struct arg_list *tabs;
1067 unsigned tabcount, *tab;
1070 // toys/posix/file.c
1076 // toys/posix/find.c
1080 struct double_list *argdata;
1081 int topdir, xdev, depth;
1085 // toys/posix/grep.c
1095 char indelim, outdelim;
1098 // toys/posix/head.c
1111 // toys/posix/kill.c
1115 struct arg_list *olist;
1123 struct dirtree *files, *singledir;
1125 unsigned screen_width;
1130 // toys/posix/mkdir.c
1137 // toys/posix/mkfifo.c
1139 struct mkfifo_data {
1146 // toys/posix/nice.c
1162 // Count of consecutive blank lines for -l has to persist between files
1169 struct arg_list *output_base;
1176 unsigned types, leftover, star;
1177 char *buf; // Points to buffers[0] or buffers[1].
1178 char *bufs[2]; // Used to detect duplicate lines.
1182 // toys/posix/paste.c
1188 // toys/posix/patch.c
1195 struct double_list *current_hunk;
1196 long oldline, oldlen, newline, newlen;
1198 int context, state, filein, fileout, filepatch, hunknum;
1240 void *regexes, *snapshot;
1247 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1248 struct dirtree *threadparent;
1249 unsigned width, height;
1251 void *fields, *kfields;
1252 long long ticks, bits, time;
1253 int kcount, forcek, sortpos;
1254 int (*match_process)(long long *slot);
1255 void (*show_process)(void *tb);
1258 // toys/posix/renice.c
1260 struct renice_data {
1270 // processed pattern list
1271 struct double_list *pattern;
1273 char *nextline, *remember;
1274 void *restart, *lastregex;
1275 long nextlen, rememberlen, count;
1280 // toys/posix/sort.c
1283 char *key_separator;
1284 struct arg_list *raw_keys;
1286 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1293 // toys/posix/split.c
1303 // toys/posix/strings.c
1305 struct strings_data {
1309 // toys/posix/tail.c
1315 int file_no, ffd, *files;
1324 // toys/posix/touch.c
1332 // toys/posix/ulimit.c
1334 struct ulimit_data {
1338 // toys/posix/uniq.c
1347 // toys/posix/uudecode.c
1349 struct uudecode_data {
1356 unsigned long totals[4];
1359 // toys/posix/xargs.c
1368 long entries, bytes;
1372 extern union global_union {
1373 struct getprop_data getprop;
1374 struct log_data log;
1375 struct hello_data hello;
1376 struct skeleton_data skeleton;
1377 struct dmesg_data dmesg;
1378 struct hostname_data hostname;
1379 struct killall_data killall;
1380 struct md5sum_data md5sum;
1381 struct mknod_data mknod;
1382 struct mktemp_data mktemp;
1383 struct mount_data mount;
1384 struct passwd_data passwd;
1385 struct pidof_data pidof;
1386 struct seq_data seq;
1388 struct umount_data umount;
1389 struct ifconfig_data ifconfig;
1390 struct netcat_data netcat;
1391 struct netstat_data netstat;
1392 struct tunctl_data tunctl;
1393 struct acpi_data acpi;
1394 struct base64_data base64;
1395 struct blockdev_data blockdev;
1396 struct dos2unix_data dos2unix;
1397 struct fallocate_data fallocate;
1398 struct free_data free;
1399 struct hexedit_data hexedit;
1400 struct hwclock_data hwclock;
1401 struct ionice_data ionice;
1402 struct login_data login;
1403 struct losetup_data losetup;
1404 struct lspci_data lspci;
1405 struct makedevs_data makedevs;
1406 struct mix_data mix;
1407 struct mkpasswd_data mkpasswd;
1408 struct mkswap_data mkswap;
1409 struct modinfo_data modinfo;
1410 struct nsenter_data nsenter;
1411 struct oneit_data oneit;
1412 struct shred_data shred;
1413 struct stat_data stat;
1414 struct swapon_data swapon;
1415 struct switch_root_data switch_root;
1416 struct timeout_data timeout;
1417 struct truncate_data truncate;
1418 struct xxd_data xxd;
1419 struct arp_data arp;
1420 struct arping_data arping;
1421 struct bootchartd_data bootchartd;
1422 struct brctl_data brctl;
1423 struct chrt_data chrt;
1424 struct compress_data compress;
1425 struct crond_data crond;
1426 struct crontab_data crontab;
1428 struct dhcp_data dhcp;
1429 struct dhcp6_data dhcp6;
1430 struct dhcpd_data dhcpd;
1431 struct diff_data diff;
1432 struct dumpleases_data dumpleases;
1433 struct expr_data expr;
1434 struct fdisk_data fdisk;
1435 struct fold_data fold;
1436 struct fsck_data fsck;
1437 struct ftpget_data ftpget;
1438 struct getfattr_data getfattr;
1439 struct getty_data getty;
1440 struct groupadd_data groupadd;
1441 struct host_data host;
1442 struct iconv_data iconv;
1444 struct ipcrm_data ipcrm;
1445 struct ipcs_data ipcs;
1446 struct klogd_data klogd;
1447 struct last_data last;
1448 struct logger_data logger;
1449 struct lsof_data lsof;
1450 struct mke2fs_data mke2fs;
1451 struct modprobe_data modprobe;
1452 struct more_data more;
1453 struct openvt_data openvt;
1454 struct ping_data ping;
1455 struct route_data route;
1456 struct setfattr_data setfattr;
1458 struct sulogin_data sulogin;
1459 struct syslogd_data syslogd;
1460 struct tar_data tar;
1461 struct tcpsvd_data tcpsvd;
1462 struct telnet_data telnet;
1463 struct telnetd_data telnetd;
1464 struct tftp_data tftp;
1465 struct tftpd_data tftpd;
1467 struct traceroute_data traceroute;
1468 struct useradd_data useradd;
1470 struct watch_data watch;
1471 struct wget_data wget;
1472 struct chgrp_data chgrp;
1473 struct chmod_data chmod;
1474 struct cksum_data cksum;
1475 struct cmp_data cmp;
1477 struct cpio_data cpio;
1478 struct cut_data cut;
1479 struct date_data date;
1482 struct env_data env;
1483 struct expand_data expand;
1484 struct file_data file;
1485 struct find_data find;
1486 struct grep_data grep;
1487 struct head_data head;
1489 struct kill_data kill;
1491 struct mkdir_data mkdir;
1492 struct mkfifo_data mkfifo;
1493 struct nice_data nice;
1496 struct paste_data paste;
1497 struct patch_data patch;
1499 struct renice_data renice;
1500 struct sed_data sed;
1501 struct sort_data sort;
1502 struct split_data split;
1503 struct strings_data strings;
1504 struct tail_data tail;
1505 struct tee_data tee;
1506 struct touch_data touch;
1507 struct ulimit_data ulimit;
1508 struct uniq_data uniq;
1509 struct uudecode_data uudecode;
1511 struct xargs_data xargs;