1 // toys/android/getprop.c
5 char **nv; // name/value pairs: even=name, odd=value
6 struct selabel_handle *handle;
9 // toys/example/hello.c
15 // toys/example/skeleton.c
17 struct skeleton_data {
22 struct arg_list *d_list;
81 struct arg_list *optlist;
127 int ac, bat, therm, cool;
131 // toys/other/base64.c
139 // toys/other/blockdev.c
141 struct blockdev_data {
145 // toys/other/dos2unix.c
147 struct dos2unix_data {
151 // toys/other/fallocate.c
153 struct fallocate_data {
161 unsigned long long units;
165 // toys/other/hexedit.c
167 struct hexedit_data {
170 int numlen, undo, undolen;
174 // toys/other/hwclock.c
176 struct hwclock_data {
182 // toys/other/ifconfig.c
184 struct ifconfig_data {
188 // toys/other/ionice.c
196 // toys/other/login.c
202 int login_timeout, login_fail_timeout;
205 // toys/other/losetup.c
207 struct losetup_data {
217 // toys/other/lspci.c
226 // toys/other/makedevs.c
228 struct makedevs_data {
241 // toys/other/mkpasswd.c
243 struct mkpasswd_data {
249 // toys/other/mkswap.c
255 // toys/other/modinfo.c
257 struct modinfo_data {
265 // toys/other/netcat.c
268 char *filename; // -f read from filename instead of network
269 long quit_delay; // -q Exit after EOF from stdin after # seconds.
270 char *source_address; // -s Bind to a specific source address.
271 long port; // -p Bind to a specific source port.
272 long wait; // -w Wait # seconds for a connection.
275 // toys/other/nsenter.c
277 struct nsenter_data {
282 // toys/other/oneit.c
288 // toys/other/shred.c
307 struct passwd *user_name;
308 struct group *group_name;
311 // toys/other/swapon.c
317 // toys/other/switch_root.c
319 struct switch_root_data {
325 // toys/other/timeout.c
327 struct timeout_data {
334 struct itimerval itv;
337 // toys/other/truncate.c
339 struct truncate_data {
354 // toys/pending/arp.c
366 // toys/pending/arping.c
370 unsigned long time_out;
375 unsigned long start, end;
376 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
380 // toys/pending/bootchartd.c
382 struct bootchartd_data {
384 long smpl_period_usec;
391 // toys/pending/brctl.c
397 // toys/pending/compress.c
399 struct compress_data {
400 // Huffman codes: base offset and extra bits tables (length and distance)
401 char lenbits[29], distbits[30];
402 unsigned short lenbase[29], distbase[30];
403 void *fixdisthuff, *fixlithuff;
406 void (*crcfunc)(char *data, int len);
409 // Compressed data buffer
414 // Tables only used for deflation
415 unsigned short *hashhead, *hashchain;
418 // toys/pending/crond.c
426 time_t crontabs_dir_mtime;
430 // toys/pending/crontab.c
432 struct crontab_data {
443 // toys/pending/dhcp.c
452 struct arg_list *req_opt;
454 struct arg_list *pkt_opt;
460 // toys/pending/dhcp6.c
463 char *interface_name, *pidfile, *script;
464 long retry, timeout, errortimeout;
466 int length, state, request_length, sock, sock1, status, retval, retries;
468 uint8_t transction_id[3];
469 struct sockaddr_in6 input_socket6;
472 // toys/pending/dhcpd.c
479 // toys/pending/diff.c
484 struct arg_list *L_list;
486 int dir_num, size, is_binary, status, change, len[2];
490 // toys/pending/dumpleases.c
492 struct dumpleases_data {
496 // toys/pending/expr.c
499 char **tok; // current token, not on the stack since recursive calls mutate it
504 // toys/pending/fdisk.c
513 // toys/pending/file.c
519 // toys/pending/fold.c
525 // toys/pending/fsck.c
531 struct double_list *devices;
541 // toys/pending/ftpget.c
544 long port; // char *port;
551 char buf[sizeof(struct sockaddr_storage)];
554 // toys/pending/getty.c
566 struct termios termios;
570 // toys/pending/groupadd.c
572 struct groupadd_data {
576 // toys/pending/host.c
582 // toys/pending/iconv.c
594 char stats, singleline, flush, *filter_dev, gbuf[8192];
595 int sockfd, connected, from_ok, route_cmd;
596 int8_t addressfamily, is_addr;
599 // toys/pending/ipcrm.c
602 struct arg_list *qkey;
603 struct arg_list *qid;
604 struct arg_list *skey;
605 struct arg_list *sid;
606 struct arg_list *mkey;
607 struct arg_list *mid;
610 // toys/pending/ipcs.c
616 // toys/pending/klogd.c
624 // toys/pending/last.c
629 struct arg_list *list;
632 // toys/pending/logger.c
639 // toys/pending/lsof.c
644 struct stat *sought_files;
646 struct double_list *all_sockets;
647 struct double_list *files;
652 // toys/pending/mke2fs.c
655 // Command line arguments.
657 long bytes_per_inode;
658 long inodes; // Total inodes in filesystem.
659 long reserved_percent; // Integer precent of space to reserve for root.
660 char *gendir; // Where to read dirtree from.
663 struct dirtree *dt; // Tree of files to copy into the new filesystem.
664 unsigned treeblocks; // Blocks used by dt
665 unsigned treeinodes; // Inodes used by dt
667 unsigned blocks; // Total blocks in the filesystem.
668 unsigned freeblocks; // Free blocks in the filesystem.
669 unsigned inodespg; // Inodes per group
670 unsigned groups; // Total number of block groups.
671 unsigned blockbits; // Bits per block. (Also blocks per group.)
674 unsigned nextblock; // Next data block to allocate
675 unsigned nextgroup; // Next group we'll be allocating from
676 int fsfd; // File descriptor of filesystem (to output to).
678 struct ext2_superblock sb;
681 // toys/pending/modprobe.c
683 struct modprobe_data {
684 struct arg_list *probes;
685 struct arg_list *dbase[256];
689 void (*dbg)(char *format, ...);
692 // toys/pending/more.c
699 // toys/pending/netstat.c
701 struct netstat_data {
702 char current_name[21];
703 int some_process_unidentified;
706 // toys/pending/openvt.c
709 unsigned long vt_num;
712 // toys/pending/ping.c
725 // toys/pending/route.c
737 // toys/pending/sulogin.c
739 struct sulogin_data {
741 struct termios crntio;
744 // toys/pending/syslogd.c
746 struct syslogd_data {
757 struct unsocks *lsocks; // list of listen sockets
758 struct logfile *lfiles; // list of write logfiles
762 // toys/pending/tar.c
767 struct arg_list *inc_file;
768 struct arg_list *exc_file;
770 struct arg_list *exc;
772 struct arg_list *inc, *pass;
773 void *inodes, *handle;
776 // toys/pending/tcpsvd.c
790 // toys/pending/telnet.c
800 struct termios def_term;
801 struct termios raw_term;
809 // toys/pending/telnetd.c
811 struct telnetd_data {
822 // toys/pending/tftp.c
829 struct sockaddr_storage inaddr;
833 // toys/pending/tftpd.c
845 short map[256]; //map of chars
849 // toys/pending/traceroute.c
851 struct traceroute_data {
858 struct arg_list *loose_source;
872 // toys/pending/useradd.c
874 struct useradd_data {
887 struct linestack *ls;
891 // toys/pending/watch.c
897 // toys/pending/wget.c
903 // toys/posix/chgrp.c
908 char *owner_name, *group_name;
912 // toys/posix/chmod.c
918 // toys/posix/cksum.c
921 unsigned crc_table[256];
948 int (*callback)(struct dirtree *try);
972 void (*do_cut)(int fd);
989 struct arg_list *fstype;
992 int column_widths[5];
1012 // toys/posix/expand.c
1014 struct expand_data {
1015 struct arg_list *tabs;
1017 unsigned tabcount, *tab;
1020 // toys/posix/find.c
1024 struct double_list *argdata;
1025 int topdir, xdev, depth;
1029 // toys/posix/grep.c
1039 char indelim, outdelim;
1042 // toys/posix/head.c
1055 // toys/posix/kill.c
1059 struct arg_list *olist;
1067 struct dirtree *files, *singledir;
1069 unsigned screen_width;
1071 char uid_buf[12], gid_buf[12], *escmore;
1074 // toys/posix/mkdir.c
1081 // toys/posix/mkfifo.c
1083 struct mkfifo_data {
1090 // toys/posix/nice.c
1106 // Count of consecutive blank lines for -l has to persist between files
1113 struct arg_list *output_base;
1120 unsigned types, leftover, star;
1121 char *buf; // Points to buffers[0] or buffers[1].
1122 char *bufs[2]; // Used to detect duplicate lines.
1126 // toys/posix/paste.c
1132 // toys/posix/patch.c
1138 struct double_list *current_hunk;
1139 long oldline, oldlen, newline, newlen;
1141 int context, state, filein, fileout, filepatch, hunknum;
1182 void *regexes, *snapshot;
1189 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1190 unsigned width, height;
1192 void *fields, *kfields;
1193 long long ticks, bits, time;
1194 int kcount, forcek, sortpos;
1195 int (*match_process)(long long *slot);
1196 void (*show_process)(void *tb);
1199 // toys/posix/renice.c
1201 struct renice_data {
1211 // processed pattern list
1212 struct double_list *pattern;
1214 char *nextline, *remember;
1215 void *restart, *lastregex;
1216 long nextlen, rememberlen, count;
1221 // toys/posix/sort.c
1224 char *key_separator;
1225 struct arg_list *raw_keys;
1227 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1234 // toys/posix/split.c
1244 // toys/posix/strings.c
1246 struct strings_data {
1250 // toys/posix/tail.c
1256 int file_no, ffd, *files;
1265 // toys/posix/touch.c
1273 // toys/posix/ulimit.c
1275 struct ulimit_data {
1279 // toys/posix/uniq.c
1288 // toys/posix/uudecode.c
1290 struct uudecode_data {
1297 unsigned long totals[3];
1300 // toys/posix/xargs.c
1309 long entries, bytes;
1313 extern union global_union {
1314 struct getprop_data getprop;
1315 struct hello_data hello;
1316 struct skeleton_data skeleton;
1317 struct dmesg_data dmesg;
1318 struct killall_data killall;
1319 struct md5sum_data md5sum;
1320 struct mknod_data mknod;
1321 struct mktemp_data mktemp;
1322 struct mount_data mount;
1323 struct passwd_data passwd;
1324 struct pidof_data pidof;
1325 struct seq_data seq;
1327 struct umount_data umount;
1328 struct acpi_data acpi;
1329 struct base64_data base64;
1330 struct blockdev_data blockdev;
1331 struct dos2unix_data dos2unix;
1332 struct fallocate_data fallocate;
1333 struct free_data free;
1334 struct hexedit_data hexedit;
1335 struct hwclock_data hwclock;
1336 struct ifconfig_data ifconfig;
1337 struct ionice_data ionice;
1338 struct login_data login;
1339 struct losetup_data losetup;
1340 struct lspci_data lspci;
1341 struct makedevs_data makedevs;
1342 struct mix_data mix;
1343 struct mkpasswd_data mkpasswd;
1344 struct mkswap_data mkswap;
1345 struct modinfo_data modinfo;
1346 struct netcat_data netcat;
1347 struct nsenter_data nsenter;
1348 struct oneit_data oneit;
1349 struct shred_data shred;
1350 struct stat_data stat;
1351 struct swapon_data swapon;
1352 struct switch_root_data switch_root;
1353 struct timeout_data timeout;
1354 struct truncate_data truncate;
1355 struct xxd_data xxd;
1356 struct arp_data arp;
1357 struct arping_data arping;
1358 struct bootchartd_data bootchartd;
1359 struct brctl_data brctl;
1360 struct compress_data compress;
1361 struct crond_data crond;
1362 struct crontab_data crontab;
1364 struct dhcp_data dhcp;
1365 struct dhcp6_data dhcp6;
1366 struct dhcpd_data dhcpd;
1367 struct diff_data diff;
1368 struct dumpleases_data dumpleases;
1369 struct expr_data expr;
1370 struct fdisk_data fdisk;
1371 struct file_data file;
1372 struct fold_data fold;
1373 struct fsck_data fsck;
1374 struct ftpget_data ftpget;
1375 struct getty_data getty;
1376 struct groupadd_data groupadd;
1377 struct host_data host;
1378 struct iconv_data iconv;
1380 struct ipcrm_data ipcrm;
1381 struct ipcs_data ipcs;
1382 struct klogd_data klogd;
1383 struct last_data last;
1384 struct logger_data logger;
1385 struct lsof_data lsof;
1386 struct mke2fs_data mke2fs;
1387 struct modprobe_data modprobe;
1388 struct more_data more;
1389 struct netstat_data netstat;
1390 struct openvt_data openvt;
1391 struct ping_data ping;
1392 struct route_data route;
1394 struct sulogin_data sulogin;
1395 struct syslogd_data syslogd;
1396 struct tar_data tar;
1397 struct tcpsvd_data tcpsvd;
1398 struct telnet_data telnet;
1399 struct telnetd_data telnetd;
1400 struct tftp_data tftp;
1401 struct tftpd_data tftpd;
1403 struct traceroute_data traceroute;
1404 struct useradd_data useradd;
1406 struct watch_data watch;
1407 struct wget_data wget;
1408 struct chgrp_data chgrp;
1409 struct chmod_data chmod;
1410 struct cksum_data cksum;
1411 struct cmp_data cmp;
1413 struct cpio_data cpio;
1414 struct cut_data cut;
1415 struct date_data date;
1418 struct env_data env;
1419 struct expand_data expand;
1420 struct find_data find;
1421 struct grep_data grep;
1422 struct head_data head;
1424 struct kill_data kill;
1426 struct mkdir_data mkdir;
1427 struct mkfifo_data mkfifo;
1428 struct nice_data nice;
1431 struct paste_data paste;
1432 struct patch_data patch;
1434 struct renice_data renice;
1435 struct sed_data sed;
1436 struct sort_data sort;
1437 struct split_data split;
1438 struct strings_data strings;
1439 struct tail_data tail;
1440 struct tee_data tee;
1441 struct touch_data touch;
1442 struct ulimit_data ulimit;
1443 struct uniq_data uniq;
1444 struct uudecode_data uudecode;
1446 struct xargs_data xargs;