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 {
94 struct arg_list *optlist;
137 // toys/net/ifconfig.c
139 struct ifconfig_data {
146 char *filename; // -f read from filename instead of network
147 long quit_delay; // -q Exit after EOF from stdin after # seconds.
148 char *source_address; // -s Bind to a specific source address.
149 long port; // -p Bind to a specific source port.
150 long wait; // -w Wait # seconds for a connection.
153 // toys/net/netstat.c
155 struct netstat_data {
156 struct num_cache *inodes;
163 int ac, bat, therm, cool;
167 // toys/other/base64.c
175 // toys/other/blockdev.c
177 struct blockdev_data {
181 // toys/other/dos2unix.c
183 struct dos2unix_data {
187 // toys/other/fallocate.c
189 struct fallocate_data {
197 unsigned long long units;
201 // toys/other/hexedit.c
203 struct hexedit_data {
206 int numlen, undo, undolen;
210 // toys/other/hwclock.c
212 struct hwclock_data {
218 // toys/other/ionice.c
226 // toys/other/login.c
232 int login_timeout, login_fail_timeout;
235 // toys/other/losetup.c
237 struct losetup_data {
247 // toys/other/lspci.c
256 // toys/other/makedevs.c
258 struct makedevs_data {
271 // toys/other/mkpasswd.c
273 struct mkpasswd_data {
279 // toys/other/mkswap.c
285 // toys/other/modinfo.c
287 struct modinfo_data {
295 // toys/other/nsenter.c
297 struct nsenter_data {
302 // toys/other/oneit.c
308 // toys/other/shred.c
327 struct passwd *user_name;
328 struct group *group_name;
332 // toys/other/swapon.c
338 // toys/other/switch_root.c
340 struct switch_root_data {
346 // toys/other/timeout.c
348 struct timeout_data {
355 struct itimerval itv;
358 // toys/other/truncate.c
360 struct truncate_data {
376 // toys/pending/arp.c
388 // toys/pending/arping.c
392 unsigned long time_out;
397 unsigned long start, end;
398 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
402 // toys/pending/bootchartd.c
404 struct bootchartd_data {
406 long smpl_period_usec;
413 // toys/pending/brctl.c
419 // toys/pending/compress.c
421 struct compress_data {
422 // Huffman codes: base offset and extra bits tables (length and distance)
423 char lenbits[29], distbits[30];
424 unsigned short lenbase[29], distbase[30];
425 void *fixdisthuff, *fixlithuff;
428 void (*crcfunc)(char *data, int len);
431 // Compressed data buffer
436 // Tables only used for deflation
437 unsigned short *hashhead, *hashchain;
440 // toys/pending/crond.c
448 time_t crontabs_dir_mtime;
452 // toys/pending/crontab.c
454 struct crontab_data {
464 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
465 struct timeval start;
469 unsigned char *buff, *bp;
471 unsigned long long offset;
475 // toys/pending/dhcp.c
484 struct arg_list *req_opt;
486 struct arg_list *pkt_opt;
492 // toys/pending/dhcp6.c
495 char *interface_name, *pidfile, *script;
496 long retry, timeout, errortimeout;
498 int length, state, request_length, sock, sock1, status, retval, retries;
500 uint8_t transction_id[3];
501 struct sockaddr_in6 input_socket6;
504 // toys/pending/dhcpd.c
511 // toys/pending/diff.c
516 struct arg_list *L_list;
518 int dir_num, size, is_binary, status, change, len[2];
522 // toys/pending/dumpleases.c
524 struct dumpleases_data {
528 // toys/pending/expr.c
531 char **tok; // current token, not on the stack since recursive calls mutate it
536 // toys/pending/fdisk.c
545 // toys/pending/fold.c
551 // toys/pending/fsck.c
557 struct double_list *devices;
567 // toys/pending/ftpget.c
570 long port; // char *port;
577 char buf[sizeof(struct sockaddr_storage)];
580 // toys/pending/getty.c
592 struct termios termios;
596 // toys/pending/groupadd.c
598 struct groupadd_data {
602 // toys/pending/host.c
608 // toys/pending/iconv.c
620 char stats, singleline, flush, *filter_dev, gbuf[8192];
621 int sockfd, connected, from_ok, route_cmd;
622 int8_t addressfamily, is_addr;
625 // toys/pending/ipcrm.c
628 struct arg_list *qkey;
629 struct arg_list *qid;
630 struct arg_list *skey;
631 struct arg_list *sid;
632 struct arg_list *mkey;
633 struct arg_list *mid;
636 // toys/pending/ipcs.c
642 // toys/pending/klogd.c
650 // toys/pending/last.c
655 struct arg_list *list;
658 // toys/pending/logger.c
665 // toys/pending/lsof.c
670 struct stat *sought_files;
672 struct double_list *all_sockets;
673 struct double_list *files;
678 // toys/pending/mke2fs.c
681 // Command line arguments.
683 long bytes_per_inode;
684 long inodes; // Total inodes in filesystem.
685 long reserved_percent; // Integer precent of space to reserve for root.
686 char *gendir; // Where to read dirtree from.
689 struct dirtree *dt; // Tree of files to copy into the new filesystem.
690 unsigned treeblocks; // Blocks used by dt
691 unsigned treeinodes; // Inodes used by dt
693 unsigned blocks; // Total blocks in the filesystem.
694 unsigned freeblocks; // Free blocks in the filesystem.
695 unsigned inodespg; // Inodes per group
696 unsigned groups; // Total number of block groups.
697 unsigned blockbits; // Bits per block. (Also blocks per group.)
700 unsigned nextblock; // Next data block to allocate
701 unsigned nextgroup; // Next group we'll be allocating from
702 int fsfd; // File descriptor of filesystem (to output to).
704 struct ext2_superblock sb;
707 // toys/pending/modprobe.c
709 struct modprobe_data {
710 struct arg_list *probes;
711 struct arg_list *dbase[256];
715 void (*dbg)(char *format, ...);
718 // toys/pending/more.c
725 // toys/pending/openvt.c
728 unsigned long vt_num;
731 // toys/pending/ping.c
744 // toys/pending/route.c
758 // toys/pending/sulogin.c
760 struct sulogin_data {
762 struct termios crntio;
765 // toys/pending/syslogd.c
767 struct syslogd_data {
778 struct unsocks *lsocks; // list of listen sockets
779 struct logfile *lfiles; // list of write logfiles
783 // toys/pending/tar.c
788 struct arg_list *inc_file;
789 struct arg_list *exc_file;
791 struct arg_list *exc;
793 struct arg_list *inc, *pass;
794 void *inodes, *handle;
797 // toys/pending/tcpsvd.c
811 // toys/pending/telnet.c
821 struct termios def_term;
822 struct termios raw_term;
830 // toys/pending/telnetd.c
832 struct telnetd_data {
843 // toys/pending/tftp.c
850 struct sockaddr_storage inaddr;
854 // toys/pending/tftpd.c
866 short map[256]; //map of chars
870 // toys/pending/traceroute.c
872 struct traceroute_data {
879 struct arg_list *loose_source;
893 // toys/pending/useradd.c
895 struct useradd_data {
908 struct linestack *ls;
912 // toys/pending/watch.c
918 // toys/pending/wget.c
924 // toys/posix/chgrp.c
929 char *owner_name, *group_name;
933 // toys/posix/chmod.c
939 // toys/posix/cksum.c
942 unsigned crc_table[256];
969 int (*callback)(struct dirtree *try);
993 void (*do_cut)(int fd);
1010 struct arg_list *fstype;
1013 int column_widths[5];
1033 // toys/posix/expand.c
1035 struct expand_data {
1036 struct arg_list *tabs;
1038 unsigned tabcount, *tab;
1041 // toys/posix/file.c
1047 // toys/posix/find.c
1051 struct double_list *argdata;
1052 int topdir, xdev, depth;
1056 // toys/posix/grep.c
1066 char indelim, outdelim;
1069 // toys/posix/head.c
1082 // toys/posix/kill.c
1086 struct arg_list *olist;
1094 struct dirtree *files, *singledir;
1096 unsigned screen_width;
1098 char uid_buf[12], gid_buf[12], *escmore;
1101 // toys/posix/mkdir.c
1108 // toys/posix/mkfifo.c
1110 struct mkfifo_data {
1117 // toys/posix/nice.c
1133 // Count of consecutive blank lines for -l has to persist between files
1140 struct arg_list *output_base;
1147 unsigned types, leftover, star;
1148 char *buf; // Points to buffers[0] or buffers[1].
1149 char *bufs[2]; // Used to detect duplicate lines.
1153 // toys/posix/paste.c
1159 // toys/posix/patch.c
1166 struct double_list *current_hunk;
1167 long oldline, oldlen, newline, newlen;
1169 int context, state, filein, fileout, filepatch, hunknum;
1211 void *regexes, *snapshot;
1218 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1219 struct dirtree *threadparent;
1220 unsigned width, height;
1222 void *fields, *kfields;
1223 long long ticks, bits, time;
1224 int kcount, forcek, sortpos;
1225 int (*match_process)(long long *slot);
1226 void (*show_process)(void *tb);
1229 // toys/posix/renice.c
1231 struct renice_data {
1241 // processed pattern list
1242 struct double_list *pattern;
1244 char *nextline, *remember;
1245 void *restart, *lastregex;
1246 long nextlen, rememberlen, count;
1251 // toys/posix/sort.c
1254 char *key_separator;
1255 struct arg_list *raw_keys;
1257 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1264 // toys/posix/split.c
1274 // toys/posix/strings.c
1276 struct strings_data {
1280 // toys/posix/tail.c
1286 int file_no, ffd, *files;
1295 // toys/posix/touch.c
1303 // toys/posix/ulimit.c
1305 struct ulimit_data {
1309 // toys/posix/uniq.c
1318 // toys/posix/uudecode.c
1320 struct uudecode_data {
1327 unsigned long totals[4];
1330 // toys/posix/xargs.c
1339 long entries, bytes;
1343 extern union global_union {
1344 struct getprop_data getprop;
1345 struct log_data log;
1346 struct hello_data hello;
1347 struct skeleton_data skeleton;
1348 struct dmesg_data dmesg;
1349 struct hostname_data hostname;
1350 struct killall_data killall;
1351 struct md5sum_data md5sum;
1352 struct mknod_data mknod;
1353 struct mktemp_data mktemp;
1354 struct mount_data mount;
1355 struct passwd_data passwd;
1356 struct pidof_data pidof;
1357 struct seq_data seq;
1359 struct umount_data umount;
1360 struct ifconfig_data ifconfig;
1361 struct netcat_data netcat;
1362 struct netstat_data netstat;
1363 struct acpi_data acpi;
1364 struct base64_data base64;
1365 struct blockdev_data blockdev;
1366 struct dos2unix_data dos2unix;
1367 struct fallocate_data fallocate;
1368 struct free_data free;
1369 struct hexedit_data hexedit;
1370 struct hwclock_data hwclock;
1371 struct ionice_data ionice;
1372 struct login_data login;
1373 struct losetup_data losetup;
1374 struct lspci_data lspci;
1375 struct makedevs_data makedevs;
1376 struct mix_data mix;
1377 struct mkpasswd_data mkpasswd;
1378 struct mkswap_data mkswap;
1379 struct modinfo_data modinfo;
1380 struct nsenter_data nsenter;
1381 struct oneit_data oneit;
1382 struct shred_data shred;
1383 struct stat_data stat;
1384 struct swapon_data swapon;
1385 struct switch_root_data switch_root;
1386 struct timeout_data timeout;
1387 struct truncate_data truncate;
1388 struct xxd_data xxd;
1389 struct arp_data arp;
1390 struct arping_data arping;
1391 struct bootchartd_data bootchartd;
1392 struct brctl_data brctl;
1393 struct compress_data compress;
1394 struct crond_data crond;
1395 struct crontab_data crontab;
1397 struct dhcp_data dhcp;
1398 struct dhcp6_data dhcp6;
1399 struct dhcpd_data dhcpd;
1400 struct diff_data diff;
1401 struct dumpleases_data dumpleases;
1402 struct expr_data expr;
1403 struct fdisk_data fdisk;
1404 struct fold_data fold;
1405 struct fsck_data fsck;
1406 struct ftpget_data ftpget;
1407 struct getty_data getty;
1408 struct groupadd_data groupadd;
1409 struct host_data host;
1410 struct iconv_data iconv;
1412 struct ipcrm_data ipcrm;
1413 struct ipcs_data ipcs;
1414 struct klogd_data klogd;
1415 struct last_data last;
1416 struct logger_data logger;
1417 struct lsof_data lsof;
1418 struct mke2fs_data mke2fs;
1419 struct modprobe_data modprobe;
1420 struct more_data more;
1421 struct openvt_data openvt;
1422 struct ping_data ping;
1423 struct route_data route;
1425 struct sulogin_data sulogin;
1426 struct syslogd_data syslogd;
1427 struct tar_data tar;
1428 struct tcpsvd_data tcpsvd;
1429 struct telnet_data telnet;
1430 struct telnetd_data telnetd;
1431 struct tftp_data tftp;
1432 struct tftpd_data tftpd;
1434 struct traceroute_data traceroute;
1435 struct useradd_data useradd;
1437 struct watch_data watch;
1438 struct wget_data wget;
1439 struct chgrp_data chgrp;
1440 struct chmod_data chmod;
1441 struct cksum_data cksum;
1442 struct cmp_data cmp;
1444 struct cpio_data cpio;
1445 struct cut_data cut;
1446 struct date_data date;
1449 struct env_data env;
1450 struct expand_data expand;
1451 struct file_data file;
1452 struct find_data find;
1453 struct grep_data grep;
1454 struct head_data head;
1456 struct kill_data kill;
1458 struct mkdir_data mkdir;
1459 struct mkfifo_data mkfifo;
1460 struct nice_data nice;
1463 struct paste_data paste;
1464 struct patch_data patch;
1466 struct renice_data renice;
1467 struct sed_data sed;
1468 struct sort_data sort;
1469 struct split_data split;
1470 struct strings_data strings;
1471 struct tail_data tail;
1472 struct tee_data tee;
1473 struct touch_data touch;
1474 struct ulimit_data ulimit;
1475 struct uniq_data uniq;
1476 struct uudecode_data uudecode;
1478 struct xargs_data xargs;