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 wait; // -w Wait # seconds for a connection.
158 // toys/net/netstat.c
160 struct netstat_data {
161 struct num_cache *inodes;
168 int ac, bat, therm, cool;
172 // toys/other/base64.c
180 // toys/other/blockdev.c
182 struct blockdev_data {
186 // toys/other/dos2unix.c
188 struct dos2unix_data {
192 // toys/other/fallocate.c
194 struct fallocate_data {
202 unsigned long long units;
206 // toys/other/hexedit.c
208 struct hexedit_data {
211 int numlen, undo, undolen;
215 // toys/other/hwclock.c
217 struct hwclock_data {
223 // toys/other/ionice.c
231 // toys/other/login.c
237 int login_timeout, login_fail_timeout;
240 // toys/other/losetup.c
242 struct losetup_data {
252 // toys/other/lspci.c
261 // toys/other/makedevs.c
263 struct makedevs_data {
276 // toys/other/mkpasswd.c
278 struct mkpasswd_data {
284 // toys/other/mkswap.c
290 // toys/other/modinfo.c
292 struct modinfo_data {
300 // toys/other/nsenter.c
302 struct nsenter_data {
307 // toys/other/oneit.c
313 // toys/other/setfattr.c
315 struct setfattr_data {
319 // toys/other/shred.c
338 char *file, *pattern;
342 // toys/other/swapon.c
348 // toys/other/switch_root.c
350 struct switch_root_data {
356 // toys/other/timeout.c
358 struct timeout_data {
365 struct itimerval itv;
368 // toys/other/truncate.c
370 struct truncate_data {
386 // toys/pending/arp.c
398 // toys/pending/arping.c
402 unsigned long time_out;
407 unsigned long start, end;
408 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
412 // toys/pending/bootchartd.c
414 struct bootchartd_data {
416 long smpl_period_usec;
423 // toys/pending/brctl.c
429 // toys/pending/compress.c
431 struct compress_data {
432 // Huffman codes: base offset and extra bits tables (length and distance)
433 char lenbits[29], distbits[30];
434 unsigned short lenbase[29], distbase[30];
435 void *fixdisthuff, *fixlithuff;
438 void (*crcfunc)(char *data, int len);
441 // Compressed data buffer
446 // Tables only used for deflation
447 unsigned short *hashhead, *hashchain;
450 // toys/pending/crond.c
458 time_t crontabs_dir_mtime;
462 // toys/pending/crontab.c
464 struct crontab_data {
474 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
475 struct timeval start;
479 unsigned char *buff, *bp;
481 unsigned long long offset;
485 // toys/pending/dhcp.c
494 struct arg_list *req_opt;
496 struct arg_list *pkt_opt;
502 // toys/pending/dhcp6.c
505 char *interface_name, *pidfile, *script;
506 long retry, timeout, errortimeout;
508 int length, state, request_length, sock, sock1, status, retval, retries;
510 uint8_t transction_id[3];
511 struct sockaddr_in6 input_socket6;
514 // toys/pending/dhcpd.c
521 // toys/pending/diff.c
526 struct arg_list *L_list;
528 int dir_num, size, is_binary, status, change, len[2];
532 // toys/pending/dumpleases.c
534 struct dumpleases_data {
538 // toys/pending/expr.c
541 char **tok; // current token, not on the stack since recursive calls mutate it
546 // toys/pending/fdisk.c
555 // toys/pending/fold.c
561 // toys/pending/fsck.c
567 struct double_list *devices;
577 // toys/pending/ftpget.c
580 long port; // char *port;
587 char buf[sizeof(struct sockaddr_storage)];
590 // toys/pending/getfattr.c
592 struct getfattr_data {
596 // toys/pending/getty.c
608 struct termios termios;
612 // toys/pending/groupadd.c
614 struct groupadd_data {
618 // toys/pending/host.c
624 // toys/pending/iconv.c
636 char stats, singleline, flush, *filter_dev, gbuf[8192];
637 int sockfd, connected, from_ok, route_cmd;
638 int8_t addressfamily, is_addr;
641 // toys/pending/ipcrm.c
644 struct arg_list *qkey;
645 struct arg_list *qid;
646 struct arg_list *skey;
647 struct arg_list *sid;
648 struct arg_list *mkey;
649 struct arg_list *mid;
652 // toys/pending/ipcs.c
658 // toys/pending/klogd.c
666 // toys/pending/last.c
671 struct arg_list *list;
674 // toys/pending/logger.c
681 // toys/pending/lsof.c
686 struct stat *sought_files;
688 struct double_list *all_sockets;
689 struct double_list *files;
694 // toys/pending/mke2fs.c
697 // Command line arguments.
699 long bytes_per_inode;
700 long inodes; // Total inodes in filesystem.
701 long reserved_percent; // Integer precent of space to reserve for root.
702 char *gendir; // Where to read dirtree from.
705 struct dirtree *dt; // Tree of files to copy into the new filesystem.
706 unsigned treeblocks; // Blocks used by dt
707 unsigned treeinodes; // Inodes used by dt
709 unsigned blocks; // Total blocks in the filesystem.
710 unsigned freeblocks; // Free blocks in the filesystem.
711 unsigned inodespg; // Inodes per group
712 unsigned groups; // Total number of block groups.
713 unsigned blockbits; // Bits per block. (Also blocks per group.)
716 unsigned nextblock; // Next data block to allocate
717 unsigned nextgroup; // Next group we'll be allocating from
718 int fsfd; // File descriptor of filesystem (to output to).
720 struct ext2_superblock sb;
723 // toys/pending/modprobe.c
725 struct modprobe_data {
726 struct arg_list *probes;
727 struct arg_list *dbase[256];
731 void (*dbg)(char *format, ...);
734 // toys/pending/more.c
741 // toys/pending/openvt.c
744 unsigned long vt_num;
747 // toys/pending/ping.c
760 // toys/pending/route.c
774 // toys/pending/sulogin.c
776 struct sulogin_data {
778 struct termios crntio;
781 // toys/pending/syslogd.c
783 struct syslogd_data {
794 struct unsocks *lsocks; // list of listen sockets
795 struct logfile *lfiles; // list of write logfiles
799 // toys/pending/tar.c
804 struct arg_list *inc_file;
805 struct arg_list *exc_file;
807 struct arg_list *exc;
809 struct arg_list *inc, *pass;
810 void *inodes, *handle;
813 // toys/pending/tcpsvd.c
827 // toys/pending/telnet.c
837 struct termios def_term;
838 struct termios raw_term;
846 // toys/pending/telnetd.c
848 struct telnetd_data {
859 // toys/pending/tftp.c
866 struct sockaddr_storage inaddr;
870 // toys/pending/tftpd.c
882 short map[256]; //map of chars
886 // toys/pending/traceroute.c
888 struct traceroute_data {
895 struct arg_list *loose_source;
909 // toys/pending/useradd.c
911 struct useradd_data {
924 struct linestack *ls;
928 // toys/pending/watch.c
934 // toys/pending/wget.c
940 // toys/posix/chgrp.c
945 char *owner_name, *group_name;
949 // toys/posix/chmod.c
955 // toys/posix/cksum.c
958 unsigned crc_table[256];
985 int (*callback)(struct dirtree *try);
1009 void (*do_cut)(int fd);
1012 // toys/posix/date.c
1026 struct arg_list *fstype;
1029 int column_widths[5];
1049 // toys/posix/expand.c
1051 struct expand_data {
1052 struct arg_list *tabs;
1054 unsigned tabcount, *tab;
1057 // toys/posix/file.c
1063 // toys/posix/find.c
1067 struct double_list *argdata;
1068 int topdir, xdev, depth;
1072 // toys/posix/grep.c
1082 char indelim, outdelim;
1085 // toys/posix/head.c
1098 // toys/posix/kill.c
1102 struct arg_list *olist;
1110 struct dirtree *files, *singledir;
1112 unsigned screen_width;
1117 // toys/posix/mkdir.c
1124 // toys/posix/mkfifo.c
1126 struct mkfifo_data {
1133 // toys/posix/nice.c
1149 // Count of consecutive blank lines for -l has to persist between files
1156 struct arg_list *output_base;
1163 unsigned types, leftover, star;
1164 char *buf; // Points to buffers[0] or buffers[1].
1165 char *bufs[2]; // Used to detect duplicate lines.
1169 // toys/posix/paste.c
1175 // toys/posix/patch.c
1182 struct double_list *current_hunk;
1183 long oldline, oldlen, newline, newlen;
1185 int context, state, filein, fileout, filepatch, hunknum;
1227 void *regexes, *snapshot;
1234 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1235 struct dirtree *threadparent;
1236 unsigned width, height;
1238 void *fields, *kfields;
1239 long long ticks, bits, time;
1240 int kcount, forcek, sortpos;
1241 int (*match_process)(long long *slot);
1242 void (*show_process)(void *tb);
1245 // toys/posix/renice.c
1247 struct renice_data {
1257 // processed pattern list
1258 struct double_list *pattern;
1260 char *nextline, *remember;
1261 void *restart, *lastregex;
1262 long nextlen, rememberlen, count;
1267 // toys/posix/sort.c
1270 char *key_separator;
1271 struct arg_list *raw_keys;
1273 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1280 // toys/posix/split.c
1290 // toys/posix/strings.c
1292 struct strings_data {
1296 // toys/posix/tail.c
1302 int file_no, ffd, *files;
1311 // toys/posix/touch.c
1319 // toys/posix/ulimit.c
1321 struct ulimit_data {
1325 // toys/posix/uniq.c
1334 // toys/posix/uudecode.c
1336 struct uudecode_data {
1343 unsigned long totals[4];
1346 // toys/posix/xargs.c
1355 long entries, bytes;
1359 extern union global_union {
1360 struct getprop_data getprop;
1361 struct log_data log;
1362 struct hello_data hello;
1363 struct skeleton_data skeleton;
1364 struct dmesg_data dmesg;
1365 struct hostname_data hostname;
1366 struct killall_data killall;
1367 struct md5sum_data md5sum;
1368 struct mknod_data mknod;
1369 struct mktemp_data mktemp;
1370 struct mount_data mount;
1371 struct passwd_data passwd;
1372 struct pidof_data pidof;
1373 struct seq_data seq;
1375 struct umount_data umount;
1376 struct ifconfig_data ifconfig;
1377 struct netcat_data netcat;
1378 struct netstat_data netstat;
1379 struct acpi_data acpi;
1380 struct base64_data base64;
1381 struct blockdev_data blockdev;
1382 struct dos2unix_data dos2unix;
1383 struct fallocate_data fallocate;
1384 struct free_data free;
1385 struct hexedit_data hexedit;
1386 struct hwclock_data hwclock;
1387 struct ionice_data ionice;
1388 struct login_data login;
1389 struct losetup_data losetup;
1390 struct lspci_data lspci;
1391 struct makedevs_data makedevs;
1392 struct mix_data mix;
1393 struct mkpasswd_data mkpasswd;
1394 struct mkswap_data mkswap;
1395 struct modinfo_data modinfo;
1396 struct nsenter_data nsenter;
1397 struct oneit_data oneit;
1398 struct setfattr_data setfattr;
1399 struct shred_data shred;
1400 struct stat_data stat;
1401 struct swapon_data swapon;
1402 struct switch_root_data switch_root;
1403 struct timeout_data timeout;
1404 struct truncate_data truncate;
1405 struct xxd_data xxd;
1406 struct arp_data arp;
1407 struct arping_data arping;
1408 struct bootchartd_data bootchartd;
1409 struct brctl_data brctl;
1410 struct compress_data compress;
1411 struct crond_data crond;
1412 struct crontab_data crontab;
1414 struct dhcp_data dhcp;
1415 struct dhcp6_data dhcp6;
1416 struct dhcpd_data dhcpd;
1417 struct diff_data diff;
1418 struct dumpleases_data dumpleases;
1419 struct expr_data expr;
1420 struct fdisk_data fdisk;
1421 struct fold_data fold;
1422 struct fsck_data fsck;
1423 struct ftpget_data ftpget;
1424 struct getfattr_data getfattr;
1425 struct getty_data getty;
1426 struct groupadd_data groupadd;
1427 struct host_data host;
1428 struct iconv_data iconv;
1430 struct ipcrm_data ipcrm;
1431 struct ipcs_data ipcs;
1432 struct klogd_data klogd;
1433 struct last_data last;
1434 struct logger_data logger;
1435 struct lsof_data lsof;
1436 struct mke2fs_data mke2fs;
1437 struct modprobe_data modprobe;
1438 struct more_data more;
1439 struct openvt_data openvt;
1440 struct ping_data ping;
1441 struct route_data route;
1443 struct sulogin_data sulogin;
1444 struct syslogd_data syslogd;
1445 struct tar_data tar;
1446 struct tcpsvd_data tcpsvd;
1447 struct telnet_data telnet;
1448 struct telnetd_data telnetd;
1449 struct tftp_data tftp;
1450 struct tftpd_data tftpd;
1452 struct traceroute_data traceroute;
1453 struct useradd_data useradd;
1455 struct watch_data watch;
1456 struct wget_data wget;
1457 struct chgrp_data chgrp;
1458 struct chmod_data chmod;
1459 struct cksum_data cksum;
1460 struct cmp_data cmp;
1462 struct cpio_data cpio;
1463 struct cut_data cut;
1464 struct date_data date;
1467 struct env_data env;
1468 struct expand_data expand;
1469 struct file_data file;
1470 struct find_data find;
1471 struct grep_data grep;
1472 struct head_data head;
1474 struct kill_data kill;
1476 struct mkdir_data mkdir;
1477 struct mkfifo_data mkfifo;
1478 struct nice_data nice;
1481 struct paste_data paste;
1482 struct patch_data patch;
1484 struct renice_data renice;
1485 struct sed_data sed;
1486 struct sort_data sort;
1487 struct split_data split;
1488 struct strings_data strings;
1489 struct tail_data tail;
1490 struct tee_data tee;
1491 struct touch_data touch;
1492 struct ulimit_data ulimit;
1493 struct uniq_data uniq;
1494 struct uudecode_data uudecode;
1496 struct xargs_data xargs;