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/shred.c
332 struct passwd *user_name;
333 struct group *group_name;
337 // toys/other/swapon.c
343 // toys/other/switch_root.c
345 struct switch_root_data {
351 // toys/other/timeout.c
353 struct timeout_data {
360 struct itimerval itv;
363 // toys/other/truncate.c
365 struct truncate_data {
381 // toys/pending/arp.c
393 // toys/pending/arping.c
397 unsigned long time_out;
402 unsigned long start, end;
403 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
407 // toys/pending/bootchartd.c
409 struct bootchartd_data {
411 long smpl_period_usec;
418 // toys/pending/brctl.c
424 // toys/pending/compress.c
426 struct compress_data {
427 // Huffman codes: base offset and extra bits tables (length and distance)
428 char lenbits[29], distbits[30];
429 unsigned short lenbase[29], distbase[30];
430 void *fixdisthuff, *fixlithuff;
433 void (*crcfunc)(char *data, int len);
436 // Compressed data buffer
441 // Tables only used for deflation
442 unsigned short *hashhead, *hashchain;
445 // toys/pending/crond.c
453 time_t crontabs_dir_mtime;
457 // toys/pending/crontab.c
459 struct crontab_data {
469 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
470 struct timeval start;
474 unsigned char *buff, *bp;
476 unsigned long long offset;
480 // toys/pending/dhcp.c
489 struct arg_list *req_opt;
491 struct arg_list *pkt_opt;
497 // toys/pending/dhcp6.c
500 char *interface_name, *pidfile, *script;
501 long retry, timeout, errortimeout;
503 int length, state, request_length, sock, sock1, status, retval, retries;
505 uint8_t transction_id[3];
506 struct sockaddr_in6 input_socket6;
509 // toys/pending/dhcpd.c
516 // toys/pending/diff.c
521 struct arg_list *L_list;
523 int dir_num, size, is_binary, status, change, len[2];
527 // toys/pending/dumpleases.c
529 struct dumpleases_data {
533 // toys/pending/expr.c
536 char **tok; // current token, not on the stack since recursive calls mutate it
541 // toys/pending/fdisk.c
550 // toys/pending/fold.c
556 // toys/pending/fsck.c
562 struct double_list *devices;
572 // toys/pending/ftpget.c
575 long port; // char *port;
582 char buf[sizeof(struct sockaddr_storage)];
585 // toys/pending/getty.c
597 struct termios termios;
601 // toys/pending/groupadd.c
603 struct groupadd_data {
607 // toys/pending/host.c
613 // toys/pending/iconv.c
625 char stats, singleline, flush, *filter_dev, gbuf[8192];
626 int sockfd, connected, from_ok, route_cmd;
627 int8_t addressfamily, is_addr;
630 // toys/pending/ipcrm.c
633 struct arg_list *qkey;
634 struct arg_list *qid;
635 struct arg_list *skey;
636 struct arg_list *sid;
637 struct arg_list *mkey;
638 struct arg_list *mid;
641 // toys/pending/ipcs.c
647 // toys/pending/klogd.c
655 // toys/pending/last.c
660 struct arg_list *list;
663 // toys/pending/logger.c
670 // toys/pending/lsof.c
675 struct stat *sought_files;
677 struct double_list *all_sockets;
678 struct double_list *files;
683 // toys/pending/mke2fs.c
686 // Command line arguments.
688 long bytes_per_inode;
689 long inodes; // Total inodes in filesystem.
690 long reserved_percent; // Integer precent of space to reserve for root.
691 char *gendir; // Where to read dirtree from.
694 struct dirtree *dt; // Tree of files to copy into the new filesystem.
695 unsigned treeblocks; // Blocks used by dt
696 unsigned treeinodes; // Inodes used by dt
698 unsigned blocks; // Total blocks in the filesystem.
699 unsigned freeblocks; // Free blocks in the filesystem.
700 unsigned inodespg; // Inodes per group
701 unsigned groups; // Total number of block groups.
702 unsigned blockbits; // Bits per block. (Also blocks per group.)
705 unsigned nextblock; // Next data block to allocate
706 unsigned nextgroup; // Next group we'll be allocating from
707 int fsfd; // File descriptor of filesystem (to output to).
709 struct ext2_superblock sb;
712 // toys/pending/modprobe.c
714 struct modprobe_data {
715 struct arg_list *probes;
716 struct arg_list *dbase[256];
720 void (*dbg)(char *format, ...);
723 // toys/pending/more.c
730 // toys/pending/openvt.c
733 unsigned long vt_num;
736 // toys/pending/ping.c
749 // toys/pending/route.c
763 // toys/pending/sulogin.c
765 struct sulogin_data {
767 struct termios crntio;
770 // toys/pending/syslogd.c
772 struct syslogd_data {
783 struct unsocks *lsocks; // list of listen sockets
784 struct logfile *lfiles; // list of write logfiles
788 // toys/pending/tar.c
793 struct arg_list *inc_file;
794 struct arg_list *exc_file;
796 struct arg_list *exc;
798 struct arg_list *inc, *pass;
799 void *inodes, *handle;
802 // toys/pending/tcpsvd.c
816 // toys/pending/telnet.c
826 struct termios def_term;
827 struct termios raw_term;
835 // toys/pending/telnetd.c
837 struct telnetd_data {
848 // toys/pending/tftp.c
855 struct sockaddr_storage inaddr;
859 // toys/pending/tftpd.c
871 short map[256]; //map of chars
875 // toys/pending/traceroute.c
877 struct traceroute_data {
884 struct arg_list *loose_source;
898 // toys/pending/useradd.c
900 struct useradd_data {
913 struct linestack *ls;
917 // toys/pending/watch.c
923 // toys/pending/wget.c
929 // toys/posix/chgrp.c
934 char *owner_name, *group_name;
938 // toys/posix/chmod.c
944 // toys/posix/cksum.c
947 unsigned crc_table[256];
974 int (*callback)(struct dirtree *try);
998 void (*do_cut)(int fd);
1001 // toys/posix/date.c
1015 struct arg_list *fstype;
1018 int column_widths[5];
1038 // toys/posix/expand.c
1040 struct expand_data {
1041 struct arg_list *tabs;
1043 unsigned tabcount, *tab;
1046 // toys/posix/file.c
1052 // toys/posix/find.c
1056 struct double_list *argdata;
1057 int topdir, xdev, depth;
1061 // toys/posix/grep.c
1071 char indelim, outdelim;
1074 // toys/posix/head.c
1087 // toys/posix/kill.c
1091 struct arg_list *olist;
1099 struct dirtree *files, *singledir;
1101 unsigned screen_width;
1103 char uid_buf[12], gid_buf[12], *escmore;
1106 // toys/posix/mkdir.c
1113 // toys/posix/mkfifo.c
1115 struct mkfifo_data {
1122 // toys/posix/nice.c
1138 // Count of consecutive blank lines for -l has to persist between files
1145 struct arg_list *output_base;
1152 unsigned types, leftover, star;
1153 char *buf; // Points to buffers[0] or buffers[1].
1154 char *bufs[2]; // Used to detect duplicate lines.
1158 // toys/posix/paste.c
1164 // toys/posix/patch.c
1171 struct double_list *current_hunk;
1172 long oldline, oldlen, newline, newlen;
1174 int context, state, filein, fileout, filepatch, hunknum;
1216 void *regexes, *snapshot;
1223 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1224 struct dirtree *threadparent;
1225 unsigned width, height;
1227 void *fields, *kfields;
1228 long long ticks, bits, time;
1229 int kcount, forcek, sortpos;
1230 int (*match_process)(long long *slot);
1231 void (*show_process)(void *tb);
1234 // toys/posix/renice.c
1236 struct renice_data {
1246 // processed pattern list
1247 struct double_list *pattern;
1249 char *nextline, *remember;
1250 void *restart, *lastregex;
1251 long nextlen, rememberlen, count;
1256 // toys/posix/sort.c
1259 char *key_separator;
1260 struct arg_list *raw_keys;
1262 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1269 // toys/posix/split.c
1279 // toys/posix/strings.c
1281 struct strings_data {
1285 // toys/posix/tail.c
1291 int file_no, ffd, *files;
1300 // toys/posix/touch.c
1308 // toys/posix/ulimit.c
1310 struct ulimit_data {
1314 // toys/posix/uniq.c
1323 // toys/posix/uudecode.c
1325 struct uudecode_data {
1332 unsigned long totals[4];
1335 // toys/posix/xargs.c
1344 long entries, bytes;
1348 extern union global_union {
1349 struct getprop_data getprop;
1350 struct log_data log;
1351 struct hello_data hello;
1352 struct skeleton_data skeleton;
1353 struct dmesg_data dmesg;
1354 struct hostname_data hostname;
1355 struct killall_data killall;
1356 struct md5sum_data md5sum;
1357 struct mknod_data mknod;
1358 struct mktemp_data mktemp;
1359 struct mount_data mount;
1360 struct passwd_data passwd;
1361 struct pidof_data pidof;
1362 struct seq_data seq;
1364 struct umount_data umount;
1365 struct ifconfig_data ifconfig;
1366 struct netcat_data netcat;
1367 struct netstat_data netstat;
1368 struct acpi_data acpi;
1369 struct base64_data base64;
1370 struct blockdev_data blockdev;
1371 struct dos2unix_data dos2unix;
1372 struct fallocate_data fallocate;
1373 struct free_data free;
1374 struct hexedit_data hexedit;
1375 struct hwclock_data hwclock;
1376 struct ionice_data ionice;
1377 struct login_data login;
1378 struct losetup_data losetup;
1379 struct lspci_data lspci;
1380 struct makedevs_data makedevs;
1381 struct mix_data mix;
1382 struct mkpasswd_data mkpasswd;
1383 struct mkswap_data mkswap;
1384 struct modinfo_data modinfo;
1385 struct nsenter_data nsenter;
1386 struct oneit_data oneit;
1387 struct shred_data shred;
1388 struct stat_data stat;
1389 struct swapon_data swapon;
1390 struct switch_root_data switch_root;
1391 struct timeout_data timeout;
1392 struct truncate_data truncate;
1393 struct xxd_data xxd;
1394 struct arp_data arp;
1395 struct arping_data arping;
1396 struct bootchartd_data bootchartd;
1397 struct brctl_data brctl;
1398 struct compress_data compress;
1399 struct crond_data crond;
1400 struct crontab_data crontab;
1402 struct dhcp_data dhcp;
1403 struct dhcp6_data dhcp6;
1404 struct dhcpd_data dhcpd;
1405 struct diff_data diff;
1406 struct dumpleases_data dumpleases;
1407 struct expr_data expr;
1408 struct fdisk_data fdisk;
1409 struct fold_data fold;
1410 struct fsck_data fsck;
1411 struct ftpget_data ftpget;
1412 struct getty_data getty;
1413 struct groupadd_data groupadd;
1414 struct host_data host;
1415 struct iconv_data iconv;
1417 struct ipcrm_data ipcrm;
1418 struct ipcs_data ipcs;
1419 struct klogd_data klogd;
1420 struct last_data last;
1421 struct logger_data logger;
1422 struct lsof_data lsof;
1423 struct mke2fs_data mke2fs;
1424 struct modprobe_data modprobe;
1425 struct more_data more;
1426 struct openvt_data openvt;
1427 struct ping_data ping;
1428 struct route_data route;
1430 struct sulogin_data sulogin;
1431 struct syslogd_data syslogd;
1432 struct tar_data tar;
1433 struct tcpsvd_data tcpsvd;
1434 struct telnet_data telnet;
1435 struct telnetd_data telnetd;
1436 struct tftp_data tftp;
1437 struct tftpd_data tftpd;
1439 struct traceroute_data traceroute;
1440 struct useradd_data useradd;
1442 struct watch_data watch;
1443 struct wget_data wget;
1444 struct chgrp_data chgrp;
1445 struct chmod_data chmod;
1446 struct cksum_data cksum;
1447 struct cmp_data cmp;
1449 struct cpio_data cpio;
1450 struct cut_data cut;
1451 struct date_data date;
1454 struct env_data env;
1455 struct expand_data expand;
1456 struct file_data file;
1457 struct find_data find;
1458 struct grep_data grep;
1459 struct head_data head;
1461 struct kill_data kill;
1463 struct mkdir_data mkdir;
1464 struct mkfifo_data mkfifo;
1465 struct nice_data nice;
1468 struct paste_data paste;
1469 struct patch_data patch;
1471 struct renice_data renice;
1472 struct sed_data sed;
1473 struct sort_data sort;
1474 struct split_data split;
1475 struct strings_data strings;
1476 struct tail_data tail;
1477 struct tee_data tee;
1478 struct touch_data touch;
1479 struct ulimit_data ulimit;
1480 struct uniq_data uniq;
1481 struct uudecode_data uudecode;
1483 struct xargs_data xargs;