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