1 // toys/android/getprop.c
2 
3 struct getprop_data {
4   size_t size;
5   char **nv; // name/value pairs: even=name, odd=value
6   struct selabel_handle *handle;
7 };
8 
9 // toys/android/log.c
10 
11 struct log_data {
12   char *tag;
13   char *pri;
14 };
15 
16 // toys/example/hello.c
17 
18 struct hello_data {
19   int unused;
20 };
21 
22 // toys/example/skeleton.c
23 
24 struct skeleton_data {
25   union {
26     struct {
27       char *b_string;
28       long c_number;
29       struct arg_list *d_list;
30       long e_count;
31       char *also_string;
32       char *blubber_string;
33     } s;
34     struct {
35       long b_number;
36     } a;
37   };
38 
39   int more_globals;
40 };
41 
42 // toys/lsb/dmesg.c
43 
44 struct dmesg_data {
45   long level;
46   long size;
47 
48   int use_color;
49   time_t tea;
50 };
51 
52 // toys/lsb/hostname.c
53 
54 struct hostname_data {
55   char *fname;
56 };
57 
58 // toys/lsb/killall.c
59 
60 struct killall_data {
61   char *sig;
62 
63   int signum;
64   pid_t cur_pid;
65   char **names;
66   short *err;
67 };
68 
69 // toys/lsb/md5sum.c
70 
71 struct md5sum_data {
72   struct arg_list *c;
73 
74   int sawline;
75 
76   // Crypto variables blanked after summing
77   unsigned state[5];
78   unsigned oldstate[5];
79   uint64_t count;
80   union {
81     char c[64];
82     unsigned i[16];
83   } buffer;
84 };
85 
86 // toys/lsb/mknod.c
87 
88 struct mknod_data {
89   char *arg_context;
90   char *m;
91 };
92 
93 // toys/lsb/mktemp.c
94 
95 struct mktemp_data {
96   char *tmpdir;
97 };
98 
99 // toys/lsb/mount.c
100 
101 struct mount_data {
102   struct arg_list *optlist;
103   char *type;
104   char *bigO;
105 
106   unsigned long flags;
107   char *opts;
108   int okuser;
109 };
110 
111 // toys/lsb/passwd.c
112 
113 struct passwd_data {
114   char *algo;
115 };
116 
117 // toys/lsb/pidof.c
118 
119 struct pidof_data {
120   char *omit;
121 };
122 
123 // toys/lsb/seq.c
124 
125 struct seq_data {
126   char *sep;
127   char *fmt;
128 
129   int precision;
130 };
131 
132 // toys/lsb/su.c
133 
134 struct su_data {
135   char *s;
136   char *c;
137 };
138 
139 // toys/lsb/umount.c
140 
141 struct umount_data {
142   struct arg_list *t;
143 
144   char *types;
145 };
146 
147 // toys/net/ftpget.c
148 
149 struct ftpget_data {
150   char *user;
151   char *port;
152   char *password;
153 
154   int fd;
155 };
156 
157 // toys/net/ifconfig.c
158 
159 struct ifconfig_data {
160   int sockfd;
161 };
162 
163 // toys/net/microcom.c
164 
165 struct microcom_data {
166   char *s;
167 
168   int fd;
169   struct termios original_stdin_state, original_fd_state;
170 };
171 
172 // toys/net/netcat.c
173 
174 struct netcat_data {
175   char *filename;        // -f read from filename instead of network
176   long quit_delay;       // -q Exit after EOF from stdin after # seconds.
177   char *source_address;  // -s Bind to a specific source address.
178   long port;             // -p Bind to a specific source port.
179   long idle;             // -W Wait # seconds for more data
180   long wait;             // -w Wait # seconds for a connection.
181 };
182 
183 // toys/net/netstat.c
184 
185 struct netstat_data {
186   struct num_cache *inodes;
187   int wpad;
188 };;
189 
190 // toys/net/tunctl.c
191 
192 struct tunctl_data {
193   char *user;
194 };
195 
196 // toys/other/acpi.c
197 
198 struct acpi_data {
199   int ac, bat, therm, cool;
200   char *cpath;
201 };
202 
203 // toys/other/base64.c
204 
205 struct base64_data {
206   long columns;
207 
208   unsigned total;
209 };
210 
211 // toys/other/blockdev.c
212 
213 struct blockdev_data {
214   long bsz;
215 };
216 
217 // toys/other/chrt.c
218 
219 struct chrt_data {
220   long pid;
221 };
222 
223 // toys/other/dos2unix.c
224 
225 struct dos2unix_data {
226   char *tempfile;
227 };
228 
229 // toys/other/fallocate.c
230 
231 struct fallocate_data {
232   long offset;
233   long size;
234 };
235 
236 // toys/other/free.c
237 
238 struct free_data {
239   unsigned bits;
240   unsigned long long units;
241   char *buf;
242 };
243 
244 // toys/other/hexedit.c
245 
246 struct hexedit_data {
247   char *data;
248   long long len, base;
249   int numlen, undo, undolen;
250   unsigned height;
251 };
252 
253 // toys/other/hwclock.c
254 
255 struct hwclock_data {
256   char *fname;
257 
258   int utc;
259 };
260 
261 // toys/other/ionice.c
262 
263 struct ionice_data {
264   long pid;
265   long level;
266   long class;
267 };
268 
269 // toys/other/login.c
270 
271 struct login_data {
272   char *hostname;
273   char *username;
274 
275   int login_timeout, login_fail_timeout;
276 };
277 
278 // toys/other/losetup.c
279 
280 struct losetup_data {
281   char *jfile;
282   long offset;
283   long size;
284 
285   int openflags;
286   dev_t jdev;
287   ino_t jino;
288 };
289 
290 // toys/other/lspci.c
291 
292 struct lspci_data {
293   char *ids;
294   long numeric;
295 
296   FILE *db;
297 };
298 
299 // toys/other/makedevs.c
300 
301 struct makedevs_data {
302   char *fname;
303 };
304 
305 // toys/other/mix.c
306 
307 struct mix_data {
308    long right;
309    long level;
310    char *dev;
311    char *chan;
312 };
313 
314 // toys/other/mkpasswd.c
315 
316 struct mkpasswd_data {
317   long pfd;
318   char *method;
319   char *salt;
320 };
321 
322 // toys/other/mkswap.c
323 
324 struct mkswap_data {
325   char *L;
326 };
327 
328 // toys/other/modinfo.c
329 
330 struct modinfo_data {
331   char *field;
332   char *knam;
333   char *base;
334 
335   long mod;
336 };
337 
338 // toys/other/nsenter.c
339 
340 struct nsenter_data {
341   char *nsnames[6];
342   long targetpid;
343 };
344 
345 // toys/other/oneit.c
346 
347 struct oneit_data {
348   char *console;
349 };
350 
351 // toys/other/setfattr.c
352 
353 struct setfattr_data {
354   char *x, *v, *n;
355 };
356 
357 // toys/other/shred.c
358 
359 struct shred_data {
360   long offset;
361   long iterations;
362   long size;
363 
364   int ufd;
365 };
366 
367 // toys/other/stat.c
368 
369 struct stat_data {
370   char *fmt;
371 
372   union {
373     struct stat st;
374     struct statfs sf;
375   } stat;
376   char *file, *pattern;
377   int patlen;
378 };
379 
380 // toys/other/swapon.c
381 
382 struct swapon_data {
383   long priority;
384 };
385 
386 // toys/other/switch_root.c
387 
388 struct switch_root_data {
389   char *console;
390 
391   dev_t rootdev;
392 };
393 
394 // toys/other/timeout.c
395 
396 struct timeout_data {
397   char *s_signal;
398   char *k_timeout;
399 
400   int nextsig;
401   pid_t pid;
402   struct timeval ktv;
403   struct itimerval itv;
404 };
405 
406 // toys/other/truncate.c
407 
408 struct truncate_data {
409   char *s;
410 
411   long size;
412   int type;
413 };
414 
415 // toys/other/xxd.c
416 
417 struct xxd_data {
418   long s;
419   long g;
420   long l;
421   long c;
422 };
423 
424 // toys/pending/arp.c
425 
426 struct arp_data {
427     char *hw_type;
428     char *af_type_A;
429     char *af_type_p;
430     char *interface;
431 
432     int sockfd;
433     char *device;
434 };
435 
436 // toys/pending/arping.c
437 
438 struct arping_data {
439     long count;
440     unsigned long time_out;
441     char *iface;
442     char *src_ip;
443 
444     int sockfd;
445     unsigned long start, end;
446     unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
447              unicast_flag;
448 };
449 
450 // toys/pending/bootchartd.c
451 
452 struct bootchartd_data {
453   char buf[32];
454   long smpl_period_usec;
455   int proc_accounting;
456   int is_login;
457 
458   void *head;
459 };
460 
461 // toys/pending/brctl.c
462 
463 struct brctl_data {
464     int sockfd;
465 };
466 
467 // toys/pending/compress.c
468 
469 struct compress_data {
470   // Huffman codes: base offset and extra bits tables (length and distance)
471   char lenbits[29], distbits[30];
472   unsigned short lenbase[29], distbase[30];
473   void *fixdisthuff, *fixlithuff;
474 
475   // CRC
476   void (*crcfunc)(char *data, int len);
477   unsigned crc;
478 
479   // Compressed data buffer
480   char *data;
481   unsigned pos, len;
482   int infd, outfd;
483 
484   // Tables only used for deflation
485   unsigned short *hashhead, *hashchain;
486 };
487 
488 // toys/pending/crond.c
489 
490 struct crond_data {
491   char *crontabs_dir;
492   char *logfile;
493   int loglevel_d;
494   int loglevel;
495 
496   time_t crontabs_dir_mtime;
497   uint8_t flagd;
498 };
499 
500 // toys/pending/crontab.c
501 
502 struct crontab_data {
503   char *user;
504   char *cdir;
505 };
506 
507 // toys/pending/dd.c
508 
509 struct dd_data {
510   int show_xfer, show_records;
511   unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
512   struct timeval start;
513   struct {
514     char *name;
515     int fd;
516     unsigned char *buff, *bp;
517     long sz, count;
518     unsigned long long offset;
519   } in, out;
520 };;
521 
522 // toys/pending/dhcp.c
523 
524 struct dhcp_data {
525     char *iface;
526     char *pidfile;
527     char *script;
528     long retries;
529     long timeout;
530     long tryagain;
531     struct arg_list *req_opt;
532     char *req_ip;
533     struct arg_list *pkt_opt;
534     char *fdn_name;
535     char *hostname;
536     char *vendor_cls;
537 };
538 
539 // toys/pending/dhcp6.c
540 
541 struct dhcp6_data {
542   char *interface_name, *pidfile, *script;
543   long retry, timeout, errortimeout;
544   char *req_ip;
545   int length, state, request_length, sock, sock1, status, retval, retries;
546   struct timeval tv;
547   uint8_t transction_id[3];
548   struct sockaddr_in6 input_socket6;
549 };
550 
551 // toys/pending/dhcpd.c
552 
553 struct dhcpd_data {
554     char *iface;
555     long port;
556 };;
557 
558 // toys/pending/diff.c
559 
560 struct diff_data {
561   long ct;
562   char *start;
563   struct arg_list *L_list;
564 
565   int dir_num, size, is_binary, status, change, len[2];
566   int *offset[2];
567 };
568 
569 // toys/pending/dumpleases.c
570 
571 struct dumpleases_data {
572     char *file;
573 };
574 
575 // toys/pending/expr.c
576 
577 struct expr_data {
578   char **tok; // current token, not on the stack since recursive calls mutate it
579 
580   char *refree;
581 };
582 
583 // toys/pending/fdisk.c
584 
585 struct fdisk_data {
586   long sect_sz;
587   long sectors;
588   long heads;
589   long cylinders;
590 };
591 
592 // toys/pending/fmt.c
593 
594 struct fmt_data {
595   int width;
596 };
597 
598 // toys/pending/fold.c
599 
600 struct fold_data {
601   int width;
602 };
603 
604 // toys/pending/fsck.c
605 
606 struct fsck_data {
607   int fd_num;
608   char *t_list;
609 
610   struct double_list *devices;
611   char *arr_flag;
612   char **arr_type;
613   int negate;
614   int sum_status;
615   int nr_run;
616   int sig_num;
617   long max_nr_run;
618 };
619 
620 // toys/pending/getfattr.c
621 
622 struct getfattr_data {
623   char *n;
624 };
625 
626 // toys/pending/getty.c
627 
628 struct getty_data {
629   char *issue_str;
630   char *login_str;
631   char *init_str;
632   char *host_str;
633   long timeout;
634 
635   char *tty_name;
636   int  speeds[20];
637   int  sc;
638   struct termios termios;
639   char buff[128];
640 };
641 
642 // toys/pending/groupadd.c
643 
644 struct groupadd_data {
645   long gid;
646 };
647 
648 // toys/pending/gzip.c
649 
650 struct gzip_data {
651   int level;
652 };
653 
654 // toys/pending/host.c
655 
656 struct host_data {
657   char *type_str;
658 };
659 
660 // toys/pending/ip.c
661 
662 struct ip_data {
663   char stats, singleline, flush, *filter_dev, gbuf[8192];
664   int sockfd, connected, from_ok, route_cmd;
665   int8_t addressfamily, is_addr;
666 };
667 
668 // toys/pending/ipcrm.c
669 
670 struct ipcrm_data {
671   struct arg_list *qkey;
672   struct arg_list *qid;
673   struct arg_list *skey;
674   struct arg_list *sid;
675   struct arg_list *mkey;
676   struct arg_list *mid;
677 };
678 
679 // toys/pending/ipcs.c
680 
681 struct ipcs_data {
682   int id;
683 };
684 
685 // toys/pending/klogd.c
686 
687 struct klogd_data {
688   long level;
689 
690   int fd;
691 };
692 
693 // toys/pending/last.c
694 
695 struct last_data {
696   char *file;
697 
698   struct arg_list *list;
699 };
700 
701 // toys/pending/lsof.c
702 
703 struct lsof_data {
704   struct arg_list *p;
705 
706   struct stat *sought_files;
707   struct double_list *all_sockets, *files;
708   int last_shown_pid, shown_header;
709 };
710 
711 // toys/pending/mke2fs.c
712 
713 struct mke2fs_data {
714   // Command line arguments.
715   long blocksize;
716   long bytes_per_inode;
717   long inodes;           // Total inodes in filesystem.
718   long reserved_percent; // Integer precent of space to reserve for root.
719   char *gendir;          // Where to read dirtree from.
720 
721   // Internal data.
722   struct dirtree *dt;    // Tree of files to copy into the new filesystem.
723   unsigned treeblocks;   // Blocks used by dt
724   unsigned treeinodes;   // Inodes used by dt
725 
726   unsigned blocks;       // Total blocks in the filesystem.
727   unsigned freeblocks;   // Free blocks in the filesystem.
728   unsigned inodespg;     // Inodes per group
729   unsigned groups;       // Total number of block groups.
730   unsigned blockbits;    // Bits per block.  (Also blocks per group.)
731 
732   // For gene2fs
733   unsigned nextblock;    // Next data block to allocate
734   unsigned nextgroup;    // Next group we'll be allocating from
735   int fsfd;              // File descriptor of filesystem (to output to).
736 
737   struct ext2_superblock sb;
738 };
739 
740 // toys/pending/modprobe.c
741 
742 struct modprobe_data {
743   struct arg_list *dirs;
744 
745   struct arg_list *probes;
746   struct arg_list *dbase[256];
747   char *cmdopts;
748   int nudeps;
749   uint8_t symreq;
750 };
751 
752 // toys/pending/more.c
753 
754 struct more_data {
755   struct termios inf;
756   int cin_fd;
757 };
758 
759 // toys/pending/openvt.c
760 
761 struct openvt_data {
762   unsigned long vt_num;
763 };
764 
765 // toys/pending/ping.c
766 
767 struct ping_data {
768   long w;
769   long W;
770   char *i;
771   char *I;
772   long s;
773   long c;
774   long t;
775 
776   int sock;
777   long i_ms;
778 };
779 
780 // toys/pending/route.c
781 
782 struct route_data {
783   char *family;
784 };
785 
786 // toys/pending/sh.c
787 
788 struct sh_data {
789   char *command;
790 
791   long lineno;
792 };
793 
794 // toys/pending/stty.c
795 
796 struct stty_data {
797   char *device;
798 
799   int fd, col;
800   unsigned output_cols;
801 };
802 
803 // toys/pending/sulogin.c
804 
805 struct sulogin_data {
806   long timeout;
807   struct termios crntio;
808 };
809 
810 // toys/pending/syslogd.c
811 
812 struct syslogd_data {
813   char *socket;
814   char *config_file;
815   char *unix_socket;
816   char *logfile;
817   long interval;
818   long rot_size;
819   long rot_count;
820   char *remote_log;
821   long log_prio;
822 
823   struct unsocks *lsocks;  // list of listen sockets
824   struct logfile *lfiles;  // list of write logfiles
825   int sigfd[2];
826 };
827 
828 // toys/pending/tar.c
829 
830 struct tar_data {
831   char *fname;
832   char *dir;
833   struct arg_list *inc_file;
834   struct arg_list *exc_file;
835   char *tocmd;
836   struct arg_list *exc;
837 
838   struct arg_list *inc, *pass;
839   void *inodes, *handle;
840 };
841 
842 // toys/pending/tcpsvd.c
843 
844 struct tcpsvd_data {
845   char *name;
846   char *user;
847   long bn;
848   char *nmsg;
849   long cn;
850 
851   int maxc;
852   int count_all;
853   int udp;
854 };
855 
856 // toys/pending/telnet.c
857 
858 struct telnet_data {
859   int port;
860   int sfd;
861   char buff[128];
862   int pbuff;
863   char iac[256];
864   int piac;
865   char *ttype;
866   struct termios def_term;
867   struct termios raw_term;
868   uint8_t term_ok;
869   uint8_t term_mode;
870   uint8_t flags;
871   unsigned win_width;
872   unsigned win_height;
873 };
874 
875 // toys/pending/telnetd.c
876 
877 struct telnetd_data {
878     char *login_path;
879     char *issue_path;
880     int port;
881     char *host_addr;
882     long w_sec;
883 
884     int gmax_fd;
885     pid_t fork_pid;
886 };
887 
888 // toys/pending/tftp.c
889 
890 struct tftp_data {
891   char *local_file;
892   char *remote_file;
893   long block_size;
894 
895   struct sockaddr_storage inaddr;
896   int af;
897 };
898 
899 // toys/pending/tftpd.c
900 
901 struct tftpd_data {
902   char *user;
903 
904   long sfd;
905   struct passwd *pw;
906 };
907 
908 // toys/pending/tr.c
909 
910 struct tr_data {
911   short map[256]; //map of chars
912   int len1, len2;
913 };
914 
915 // toys/pending/traceroute.c
916 
917 struct traceroute_data {
918   long max_ttl;
919   long port;
920   long ttl_probes;
921   char *src_ip;
922   long tos;
923   long wait_time;
924   struct arg_list *loose_source;
925   long pause_time;
926   long first_ttl;
927   char *iface;
928 
929   uint32_t gw_list[9];
930   int recv_sock;
931   int snd_sock;
932   unsigned msg_len;
933   char *packet;
934   uint32_t ident;
935   int istraceroute6;
936 };
937 
938 // toys/pending/useradd.c
939 
940 struct useradd_data {
941   char *dir;
942   char *gecos;
943   char *shell;
944   char *u_grp;
945   long uid;
946 
947   long gid;
948 };
949 
950 // toys/pending/vi.c
951 
952 struct vi_data {
953   struct linestack *ls;
954   char *statline;
955 };
956 
957 // toys/pending/watch.c
958 
959 struct watch_data {
960   int interval;
961 };
962 
963 // toys/pending/wget.c
964 
965 struct wget_data {
966   char *filename;
967 };
968 
969 // toys/posix/chgrp.c
970 
971 struct chgrp_data {
972   uid_t owner;
973   gid_t group;
974   char *owner_name, *group_name;
975   int symfollow;
976 };
977 
978 // toys/posix/chmod.c
979 
980 struct chmod_data {
981   char *mode;
982 };
983 
984 // toys/posix/cksum.c
985 
986 struct cksum_data {
987   unsigned crc_table[256];
988 };
989 
990 // toys/posix/cmp.c
991 
992 struct cmp_data {
993   int fd;
994   char *name;
995 };
996 
997 // toys/posix/cp.c
998 
999 struct cp_data {
1000   union {
1001     struct {
1002       // install's options
1003       char *group;
1004       char *user;
1005       char *mode;
1006     } i;
1007     struct {
1008       char *preserve;
1009     } c;
1010   };
1011 
1012   char *destname;
1013   struct stat top;
1014   int (*callback)(struct dirtree *try);
1015   uid_t uid;
1016   gid_t gid;
1017   int pflags;
1018 };
1019 
1020 // toys/posix/cpio.c
1021 
1022 struct cpio_data {
1023   char *archive;
1024   char *pass;
1025   char *fmt;
1026 };
1027 
1028 // toys/posix/cut.c
1029 
1030 struct cut_data {
1031   char *d;
1032   char *O;
1033   struct arg_list *select[5]; // we treat them the same, so loop through
1034 
1035   int pairs;
1036   regex_t reg;
1037 };
1038 
1039 // toys/posix/date.c
1040 
1041 struct date_data {
1042   char *file;
1043   char *setfmt;
1044   char *showdate;
1045 
1046   unsigned nano;
1047 };
1048 
1049 // toys/posix/df.c
1050 
1051 struct df_data {
1052   struct arg_list *fstype;
1053 
1054   long units;
1055   int column_widths[5];
1056   int header_shown;
1057 };
1058 
1059 // toys/posix/du.c
1060 
1061 struct du_data {
1062   long maxdepth;
1063 
1064   unsigned long depth, total;
1065   dev_t st_dev;
1066   void *inodes;
1067 };
1068 
1069 // toys/posix/env.c
1070 
1071 struct env_data {
1072   struct arg_list *u;
1073 };;
1074 
1075 // toys/posix/expand.c
1076 
1077 struct expand_data {
1078   struct arg_list *tabs;
1079 
1080   unsigned tabcount, *tab;
1081 };
1082 
1083 // toys/posix/file.c
1084 
1085 struct file_data {
1086   int max_name_len;
1087 };
1088 
1089 // toys/posix/find.c
1090 
1091 struct find_data {
1092   char **filter;
1093   struct double_list *argdata;
1094   int topdir, xdev, depth;
1095   time_t now;
1096   long max_bytes;
1097 };
1098 
1099 // toys/posix/grep.c
1100 
1101 struct grep_data {
1102   long m;
1103   struct arg_list *f;
1104   struct arg_list *e;
1105   long a;
1106   long b;
1107   long c;
1108   struct arg_list *M;
1109   struct arg_list *S;
1110 
1111   char indelim, outdelim;
1112   int found;
1113 };
1114 
1115 // toys/posix/head.c
1116 
1117 struct head_data {
1118   long bytes;
1119   long lines;
1120   int file_no;
1121 };
1122 
1123 // toys/posix/iconv.c
1124 
1125 struct iconv_data {
1126   char *from;
1127   char *to;
1128 
1129   void *ic;
1130 };
1131 
1132 // toys/posix/id.c
1133 
1134 struct id_data {
1135   int is_groups;
1136 };
1137 
1138 // toys/posix/kill.c
1139 
1140 struct kill_data {
1141   char *signame;
1142   struct arg_list *olist;
1143 };
1144 
1145 // toys/posix/logger.c
1146 
1147 struct logger_data {
1148   char *priority;
1149   char *ident;
1150 };
1151 
1152 // toys/posix/ls.c
1153 
1154 struct ls_data {
1155   long ll;
1156   char *color;
1157 
1158   struct dirtree *files, *singledir;
1159 
1160   unsigned screen_width;
1161   int nl_title;
1162   char *escmore;
1163 };
1164 
1165 // toys/posix/mkdir.c
1166 
1167 struct mkdir_data {
1168   char *arg_mode;
1169   char *arg_context;
1170 };
1171 
1172 // toys/posix/mkfifo.c
1173 
1174 struct mkfifo_data {
1175   char *m_string;
1176   char *Z;
1177 
1178   mode_t mode;
1179 };
1180 
1181 // toys/posix/nice.c
1182 
1183 struct nice_data {
1184   long priority;
1185 };
1186 
1187 // toys/posix/nl.c
1188 
1189 struct nl_data {
1190   long w;
1191   char *s;
1192   char *n;
1193   char *b;
1194   long l;
1195   long v;
1196 
1197   // Count of consecutive blank lines for -l has to persist between files
1198   long lcount;
1199 };
1200 
1201 // toys/posix/od.c
1202 
1203 struct od_data {
1204   struct arg_list *output_base;
1205   char *address_base;
1206   long max_count;
1207   long width;
1208   long jump_bytes;
1209 
1210   int address_idx;
1211   unsigned types, leftover, star;
1212   char *buf; // Points to buffers[0] or buffers[1].
1213   char *bufs[2]; // Used to detect duplicate lines.
1214   off_t pos;
1215 };
1216 
1217 // toys/posix/paste.c
1218 
1219 struct paste_data {
1220   char *d;
1221 
1222   int files;
1223 };
1224 
1225 // toys/posix/patch.c
1226 
1227 struct patch_data {
1228   char *infile;
1229   long prefix;
1230   char *dir;
1231 
1232   struct double_list *current_hunk;
1233   long oldline, oldlen, newline, newlen;
1234   long linenum;
1235   int context, state, filein, fileout, filepatch, hunknum;
1236   char *tempname;
1237 };
1238 
1239 // toys/posix/ps.c
1240 
1241 struct ps_data {
1242   union {
1243     struct {
1244       struct arg_list *G;
1245       struct arg_list *g;
1246       struct arg_list *U;
1247       struct arg_list *u;
1248       struct arg_list *t;
1249       struct arg_list *s;
1250       struct arg_list *p;
1251       struct arg_list *O;
1252       struct arg_list *o;
1253       struct arg_list *P;
1254       struct arg_list *k;
1255     } ps;
1256     struct {
1257       long n;
1258       long m;
1259       long d;
1260       long s;
1261       struct arg_list *u;
1262       struct arg_list *p;
1263       struct arg_list *o;
1264       struct arg_list *k;
1265       struct arg_list *O;
1266     } top;
1267     struct {
1268       char *L;
1269       struct arg_list *G;
1270       struct arg_list *g;
1271       struct arg_list *P;
1272       struct arg_list *s;
1273       struct arg_list *t;
1274       struct arg_list *U;
1275       struct arg_list *u;
1276       char *d;
1277 
1278       void *regexes, *snapshot;
1279       int signal;
1280       pid_t self, match;
1281     } pgrep;
1282   };
1283 
1284   struct sysinfo si;
1285   struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1286   struct dirtree *threadparent;
1287   unsigned width, height;
1288   dev_t tty;
1289   void *fields, *kfields;
1290   long long ticks, bits, time;
1291   int kcount, forcek, sortpos;
1292   int (*match_process)(long long *slot);
1293   void (*show_process)(void *tb);
1294 };
1295 
1296 // toys/posix/renice.c
1297 
1298 struct renice_data {
1299   long nArgu;
1300 };
1301 
1302 // toys/posix/sed.c
1303 
1304 struct sed_data {
1305   struct arg_list *f;
1306   struct arg_list *e;
1307 
1308   // processed pattern list
1309   struct double_list *pattern;
1310 
1311   char *nextline, *remember;
1312   void *restart, *lastregex;
1313   long nextlen, rememberlen, count;
1314   int fdout, noeol;
1315   unsigned xx;
1316 };
1317 
1318 // toys/posix/sort.c
1319 
1320 struct sort_data {
1321   char *key_separator;
1322   struct arg_list *raw_keys;
1323   char *outfile;
1324   char *ignore1, ignore2;   // GNU compatability NOPs for -S and -T.
1325 
1326   void *key_list;
1327   int linecount;
1328   char **lines;
1329 };
1330 
1331 // toys/posix/split.c
1332 
1333 struct split_data {
1334   long lines;
1335   long bytes;
1336   long suflen;
1337 
1338   char *outfile;
1339 };
1340 
1341 // toys/posix/strings.c
1342 
1343 struct strings_data {
1344   long num;
1345   char *t;
1346 };
1347 
1348 // toys/posix/tail.c
1349 
1350 struct tail_data {
1351   long lines;
1352   long bytes;
1353 
1354   int file_no, ffd, *files;
1355 };
1356 
1357 // toys/posix/tee.c
1358 
1359 struct tee_data {
1360   void *outputs;
1361 };
1362 
1363 // toys/posix/touch.c
1364 
1365 struct touch_data {
1366   char *time;
1367   char *file;
1368   char *date;
1369 };
1370 
1371 // toys/posix/ulimit.c
1372 
1373 struct ulimit_data {
1374   long pid;
1375 };
1376 
1377 // toys/posix/uniq.c
1378 
1379 struct uniq_data {
1380   long maxchars;
1381   long nchars;
1382   long nfields;
1383   long repeats;
1384 };
1385 
1386 // toys/posix/uudecode.c
1387 
1388 struct uudecode_data {
1389   char *o;
1390 };
1391 
1392 // toys/posix/wc.c
1393 
1394 struct wc_data {
1395   unsigned long totals[4];
1396 };
1397 
1398 // toys/posix/xargs.c
1399 
1400 struct xargs_data {
1401   long max_bytes;
1402   long max_entries;
1403   long L;
1404   char *eofstr;
1405   char *I;
1406 
1407   long entries, bytes;
1408   char delim;
1409 };
1410 
1411 extern union global_union {
1412 	struct getprop_data getprop;
1413 	struct log_data log;
1414 	struct hello_data hello;
1415 	struct skeleton_data skeleton;
1416 	struct dmesg_data dmesg;
1417 	struct hostname_data hostname;
1418 	struct killall_data killall;
1419 	struct md5sum_data md5sum;
1420 	struct mknod_data mknod;
1421 	struct mktemp_data mktemp;
1422 	struct mount_data mount;
1423 	struct passwd_data passwd;
1424 	struct pidof_data pidof;
1425 	struct seq_data seq;
1426 	struct su_data su;
1427 	struct umount_data umount;
1428 	struct ftpget_data ftpget;
1429 	struct ifconfig_data ifconfig;
1430 	struct microcom_data microcom;
1431 	struct netcat_data netcat;
1432 	struct netstat_data netstat;
1433 	struct tunctl_data tunctl;
1434 	struct acpi_data acpi;
1435 	struct base64_data base64;
1436 	struct blockdev_data blockdev;
1437 	struct chrt_data chrt;
1438 	struct dos2unix_data dos2unix;
1439 	struct fallocate_data fallocate;
1440 	struct free_data free;
1441 	struct hexedit_data hexedit;
1442 	struct hwclock_data hwclock;
1443 	struct ionice_data ionice;
1444 	struct login_data login;
1445 	struct losetup_data losetup;
1446 	struct lspci_data lspci;
1447 	struct makedevs_data makedevs;
1448 	struct mix_data mix;
1449 	struct mkpasswd_data mkpasswd;
1450 	struct mkswap_data mkswap;
1451 	struct modinfo_data modinfo;
1452 	struct nsenter_data nsenter;
1453 	struct oneit_data oneit;
1454 	struct setfattr_data setfattr;
1455 	struct shred_data shred;
1456 	struct stat_data stat;
1457 	struct swapon_data swapon;
1458 	struct switch_root_data switch_root;
1459 	struct timeout_data timeout;
1460 	struct truncate_data truncate;
1461 	struct xxd_data xxd;
1462 	struct arp_data arp;
1463 	struct arping_data arping;
1464 	struct bootchartd_data bootchartd;
1465 	struct brctl_data brctl;
1466 	struct compress_data compress;
1467 	struct crond_data crond;
1468 	struct crontab_data crontab;
1469 	struct dd_data dd;
1470 	struct dhcp_data dhcp;
1471 	struct dhcp6_data dhcp6;
1472 	struct dhcpd_data dhcpd;
1473 	struct diff_data diff;
1474 	struct dumpleases_data dumpleases;
1475 	struct expr_data expr;
1476 	struct fdisk_data fdisk;
1477 	struct fmt_data fmt;
1478 	struct fold_data fold;
1479 	struct fsck_data fsck;
1480 	struct getfattr_data getfattr;
1481 	struct getty_data getty;
1482 	struct groupadd_data groupadd;
1483 	struct gzip_data gzip;
1484 	struct host_data host;
1485 	struct ip_data ip;
1486 	struct ipcrm_data ipcrm;
1487 	struct ipcs_data ipcs;
1488 	struct klogd_data klogd;
1489 	struct last_data last;
1490 	struct lsof_data lsof;
1491 	struct mke2fs_data mke2fs;
1492 	struct modprobe_data modprobe;
1493 	struct more_data more;
1494 	struct openvt_data openvt;
1495 	struct ping_data ping;
1496 	struct route_data route;
1497 	struct sh_data sh;
1498 	struct stty_data stty;
1499 	struct sulogin_data sulogin;
1500 	struct syslogd_data syslogd;
1501 	struct tar_data tar;
1502 	struct tcpsvd_data tcpsvd;
1503 	struct telnet_data telnet;
1504 	struct telnetd_data telnetd;
1505 	struct tftp_data tftp;
1506 	struct tftpd_data tftpd;
1507 	struct tr_data tr;
1508 	struct traceroute_data traceroute;
1509 	struct useradd_data useradd;
1510 	struct vi_data vi;
1511 	struct watch_data watch;
1512 	struct wget_data wget;
1513 	struct chgrp_data chgrp;
1514 	struct chmod_data chmod;
1515 	struct cksum_data cksum;
1516 	struct cmp_data cmp;
1517 	struct cp_data cp;
1518 	struct cpio_data cpio;
1519 	struct cut_data cut;
1520 	struct date_data date;
1521 	struct df_data df;
1522 	struct du_data du;
1523 	struct env_data env;
1524 	struct expand_data expand;
1525 	struct file_data file;
1526 	struct find_data find;
1527 	struct grep_data grep;
1528 	struct head_data head;
1529 	struct iconv_data iconv;
1530 	struct id_data id;
1531 	struct kill_data kill;
1532 	struct logger_data logger;
1533 	struct ls_data ls;
1534 	struct mkdir_data mkdir;
1535 	struct mkfifo_data mkfifo;
1536 	struct nice_data nice;
1537 	struct nl_data nl;
1538 	struct od_data od;
1539 	struct paste_data paste;
1540 	struct patch_data patch;
1541 	struct ps_data ps;
1542 	struct renice_data renice;
1543 	struct sed_data sed;
1544 	struct sort_data sort;
1545 	struct split_data split;
1546 	struct strings_data strings;
1547 	struct tail_data tail;
1548 	struct tee_data tee;
1549 	struct touch_data touch;
1550 	struct ulimit_data ulimit;
1551 	struct uniq_data uniq;
1552 	struct uudecode_data uudecode;
1553 	struct wc_data wc;
1554 	struct xargs_data xargs;
1555 } this;
1556