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