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, buflen; 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/awk.c 482 struct awk_data { 483 struct arg_list *f; 484 struct arg_list *v; 485 char *F; 486 487 struct scanner_state { 488 char *p; 489 char *progstring; 490 struct arg_list *prog_args; 491 char *filename; 492 char *line; 493 size_t line_size; 494 ssize_t line_len; 495 int line_num; 496 int ch; 497 FILE *fp; 498 // state includes latest token seen 499 int tok; 500 int tokbuiltin; 501 int toktype; 502 char *tokstr; 503 size_t maxtok; 504 size_t toklen; 505 double numval; 506 int error; // Set if lexical error. 507 } *scs; 508 char *tokstr; 509 int prevtok; 510 511 struct compiler_globals { 512 int in_print_stmt; 513 int paren_level; 514 int in_function_body; 515 int funcnum; 516 int nparms; 517 int compile_error_count; 518 int first_begin; 519 int last_begin; 520 int first_end; 521 int last_end; 522 int first_recrule; 523 int last_recrule; 524 int break_dest; 525 int continue_dest; 526 int stack_offset_to_fix; // fixup stack if return in for(e in a) 527 int range_pattern_num; 528 int rule_type; // tkbegin, tkend, or 0 529 } cgl; 530 531 // zvalue: the main awk value type 532 // Can be number or string or both, or else map (array) or regex 533 struct zvalue { 534 unsigned flags; 535 double num; 536 union { // anonymous union not in C99; not going to fix it now. 537 struct zstring *vst; 538 struct zmap *map; 539 regex_t *rx; 540 }; 541 } nozvalue; // to shut up compiler warning TODO FIXME 542 543 struct runtime_globals { 544 struct zvalue cur_arg; 545 //char *filename; // UNUSED 546 FILE *fp; // current data file 547 int narg; // cmdline arg index 548 int nfiles; // num of cmdline data file args processed 549 int eof; // all cmdline files (incl. stdin) read 550 char *recptr; 551 char *recbuf; 552 size_t recbufsize; 553 char *recbuf_multx; 554 size_t recbufsize_multx; 555 struct zstring *zspr; // Global to receive sprintf() string value 556 } rgl; 557 558 // Expanding sequential list 559 struct zlist { 560 char *base, *limit, *avail; 561 size_t size; 562 } globals_table, // global symbol table 563 locals_table, // local symbol table 564 func_def_table; // function symbol table 565 // runtime lists 566 struct zlist literals, fields, zcode, stack; 567 568 char *progname; 569 570 int spec_var_limit; 571 int zcode_last; 572 struct zvalue *stackp; // top of stack ptr 573 574 char *pbuf; // Used for number formatting in num_to_zstring() 575 #define RS_MAX 64 576 char rs_last[RS_MAX]; 577 regex_t rx_rs_default, rx_rs_last; 578 regex_t rx_default, rx_last, rx_printf_fmt; 579 #define FS_MAX 64 580 char fs_last[FS_MAX]; 581 char one_char_fs[4]; 582 int nf_internal; // should match NF 583 char range_sw[64]; // FIXME TODO quick and dirty set of range switches 584 int file_cnt, std_file_cnt; 585 586 struct zfile { 587 struct zfile *next; 588 char *fn; 589 FILE *fp; 590 char mode; // w, a, or r 591 char file_or_pipe; // f or p 592 char is_std_file; 593 char *recbuf; 594 size_t recbufsize; 595 char *recbuf_multi; 596 size_t recbufsize_multi; 597 char *recbuf_multx; 598 size_t recbufsize_multx; 599 int recoffs, endoffs; 600 } *zfiles, *cfile, *zstdout; 601 }; 602 603 // toys/pending/arping.c 604 605 struct arping_data { 606 long count; 607 unsigned long time_out; 608 char *iface; 609 char *src_ip; 610 611 int sockfd; 612 unsigned long start, end; 613 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv, 614 unicast_flag; 615 }; 616 617 // toys/pending/bc.c 618 619 struct bc_data { 620 // This actually needs to be a BcVm*, but the toybox build 621 // system complains if I make it so. Instead, we'll just cast. 622 char *vm; 623 624 size_t nchars; 625 char *file, sig, max_ibase; 626 uint16_t line_len; 627 }; 628 629 // toys/pending/bootchartd.c 630 631 struct bootchartd_data { 632 char timestamp[32]; 633 long msec; 634 int proc_accounting; 635 636 pid_t pid; 637 }; 638 639 // toys/pending/brctl.c 640 641 struct brctl_data { 642 int sockfd; 643 }; 644 645 // toys/pending/chsh.c 646 647 struct chsh_data { 648 char *s; 649 }; 650 651 // toys/pending/crond.c 652 653 struct crond_data { 654 char *crontabs_dir; 655 char *logfile; 656 int loglevel_d; 657 int loglevel; 658 659 time_t crontabs_dir_mtime; 660 uint8_t flagd; 661 }; 662 663 // toys/pending/crontab.c 664 665 struct crontab_data { 666 char *user; 667 char *cdir; 668 }; 669 670 // toys/pending/dd.c 671 672 struct dd_data { 673 int show_xfer, show_records; 674 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part; 675 struct timeval start; 676 struct { 677 char *name; 678 int fd; 679 unsigned char *buff, *bp; 680 long sz, count; 681 unsigned long long offset; 682 } in, out; 683 unsigned conv, iflag, oflag; 684 }; 685 686 // toys/pending/dhcp.c 687 688 struct dhcp_data { 689 char *iface; 690 char *pidfile; 691 char *script; 692 long retries; 693 long timeout; 694 long tryagain; 695 struct arg_list *req_opt; 696 char *req_ip; 697 struct arg_list *pkt_opt; 698 char *fdn_name; 699 char *hostname; 700 char *vendor_cls; 701 }; 702 703 // toys/pending/dhcp6.c 704 705 struct dhcp6_data { 706 char *interface_name, *pidfile, *script; 707 long retry, timeout, errortimeout; 708 char *req_ip; 709 int length, state, request_length, sock, sock1, status, retval, retries; 710 struct timeval tv; 711 uint8_t transction_id[3]; 712 struct sockaddr_in6 input_socket6; 713 }; 714 715 // toys/pending/dhcpd.c 716 717 struct dhcpd_data { 718 char *iface; 719 long port; 720 }; 721 722 // toys/pending/diff.c 723 724 struct diff_data { 725 long ct; 726 char *start; 727 struct arg_list *L_list; 728 729 int dir_num, size, is_binary, status, change, len[2]; 730 int *offset[2]; 731 struct stat st[2]; 732 }; 733 734 // toys/pending/dumpleases.c 735 736 struct dumpleases_data { 737 char *file; 738 }; 739 740 // toys/pending/expr.c 741 742 struct expr_data { 743 char **tok; // current token, not on the stack since recursive calls mutate it 744 745 char *refree; 746 }; 747 748 // toys/pending/fdisk.c 749 750 struct fdisk_data { 751 long sect_sz; 752 long sectors; 753 long heads; 754 long cylinders; 755 }; 756 757 // toys/pending/fold.c 758 759 struct fold_data { 760 int width; 761 }; 762 763 // toys/pending/fsck.c 764 765 struct fsck_data { 766 int fd_num; 767 char *t_list; 768 769 struct double_list *devices; 770 char *arr_flag; 771 char **arr_type; 772 int negate; 773 int sum_status; 774 int nr_run; 775 int sig_num; 776 long max_nr_run; 777 }; 778 779 // toys/pending/getfattr.c 780 781 struct getfattr_data { 782 char *n; 783 }; 784 785 // toys/pending/getopt.c 786 787 struct getopt_data { 788 struct arg_list *l; 789 char *o, *n; 790 }; 791 792 // toys/pending/getty.c 793 794 struct getty_data { 795 char *issue_str; 796 char *login_str; 797 char *init_str; 798 char *host_str; 799 long timeout; 800 801 char *tty_name; 802 int speeds[20]; 803 int sc; 804 struct termios termios; 805 char buff[128]; 806 }; 807 808 // toys/pending/groupadd.c 809 810 struct groupadd_data { 811 long gid; 812 }; 813 814 // toys/pending/hexdump.c 815 816 struct hexdump_data { 817 long s, n; 818 819 long long len, pos, ppos; 820 const char *fmt; 821 unsigned int fn, bc; // file number and byte count 822 char linebuf[16]; // line buffer - serves double duty for sqeezing repeat 823 // lines and for accumulating full lines accross file 824 // boundaries if necessesary. 825 }; 826 827 // toys/pending/host.c 828 829 struct host_data { 830 char *type_str; 831 }; 832 833 // toys/pending/ip.c 834 835 struct ip_data { 836 char stats, singleline, flush, *filter_dev, gbuf[8192]; 837 int sockfd, connected, from_ok, route_cmd; 838 int8_t addressfamily, is_addr; 839 }; 840 841 // toys/pending/ipcrm.c 842 843 struct ipcrm_data { 844 struct arg_list *qkey; 845 struct arg_list *qid; 846 struct arg_list *skey; 847 struct arg_list *sid; 848 struct arg_list *mkey; 849 struct arg_list *mid; 850 }; 851 852 // toys/pending/ipcs.c 853 854 struct ipcs_data { 855 int id; 856 }; 857 858 // toys/pending/klogd.c 859 860 struct klogd_data { 861 long level; 862 863 int fd; 864 }; 865 866 // toys/pending/last.c 867 868 struct last_data { 869 char *file; 870 871 struct arg_list *list; 872 }; 873 874 // toys/pending/lsof.c 875 876 struct lsof_data { 877 struct arg_list *p; 878 879 struct stat *sought_files; 880 struct double_list *all_sockets, *files; 881 int last_shown_pid, shown_header; 882 }; 883 884 // toys/pending/man.c 885 886 struct man_data { 887 char *M, *k; 888 889 char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs; 890 regex_t reg; 891 }; 892 893 // toys/pending/mke2fs.c 894 895 struct mke2fs_data { 896 // Command line arguments. 897 long blocksize; 898 long bytes_per_inode; 899 long inodes; // Total inodes in filesystem. 900 long reserved_percent; // Integer precent of space to reserve for root. 901 char *gendir; // Where to read dirtree from. 902 903 // Internal data. 904 struct dirtree *dt; // Tree of files to copy into the new filesystem. 905 unsigned treeblocks; // Blocks used by dt 906 unsigned treeinodes; // Inodes used by dt 907 908 unsigned blocks; // Total blocks in the filesystem. 909 unsigned freeblocks; // Free blocks in the filesystem. 910 unsigned inodespg; // Inodes per group 911 unsigned groups; // Total number of block groups. 912 unsigned blockbits; // Bits per block. (Also blocks per group.) 913 914 // For gene2fs 915 unsigned nextblock; // Next data block to allocate 916 unsigned nextgroup; // Next group we'll be allocating from 917 int fsfd; // File descriptor of filesystem (to output to). 918 }; 919 920 // toys/pending/modprobe.c 921 922 struct modprobe_data { 923 struct arg_list *dirs; 924 925 struct arg_list *probes; 926 struct arg_list *dbase[256]; 927 char *cmdopts; 928 int nudeps; 929 uint8_t symreq; 930 }; 931 932 // toys/pending/more.c 933 934 struct more_data { 935 struct termios inf; 936 int cin_fd; 937 }; 938 939 // toys/pending/openvt.c 940 941 struct openvt_data { 942 long c; 943 }; 944 945 // toys/pending/route.c 946 947 struct route_data { 948 char *family; 949 }; 950 951 // toys/pending/sh.c 952 953 struct sh_data { 954 char *command; 955 956 long lineno; 957 958 struct double_list functions; 959 unsigned options; 960 961 // Running jobs. 962 struct sh_job { 963 struct sh_job *next, *prev; 964 unsigned jobno; 965 966 // Every pipeline has at least one set of arguments or it's Not A Thing 967 struct sh_arg { 968 char **v; 969 int c; 970 } pipeline; 971 972 // null terminated array of running processes in pipeline 973 struct sh_process { 974 struct string_list *delete; // expanded strings 975 int pid, exit; // status? Stopped? Exited? 976 struct sh_arg arg; 977 } *procs, *proc; 978 } *jobs, *job; 979 unsigned jobcnt; 980 }; 981 982 // toys/pending/strace.c 983 984 struct strace_data { 985 long s, p; 986 987 char ioctl[32], *fmt; 988 long regs[256/sizeof(long)], syscall; 989 pid_t pid; 990 int arg; 991 }; 992 993 // toys/pending/stty.c 994 995 struct stty_data { 996 char *device; 997 998 int fd, col; 999 unsigned output_cols; 1000 }; 1001 1002 // toys/pending/sulogin.c 1003 1004 struct sulogin_data { 1005 long timeout; 1006 struct termios crntio; 1007 }; 1008 1009 // toys/pending/syslogd.c 1010 1011 struct syslogd_data { 1012 char *socket; 1013 char *config_file; 1014 char *unix_socket; 1015 char *logfile; 1016 long interval; 1017 long rot_size; 1018 long rot_count; 1019 char *remote_log; 1020 long log_prio; 1021 1022 struct unsocks *lsocks; // list of listen sockets 1023 struct logfile *lfiles; // list of write logfiles 1024 int sigfd[2]; 1025 }; 1026 1027 // toys/pending/tcpsvd.c 1028 1029 struct tcpsvd_data { 1030 char *name; 1031 char *user; 1032 long bn; 1033 char *nmsg; 1034 long cn; 1035 1036 int maxc; 1037 int count_all; 1038 int udp; 1039 }; 1040 1041 // toys/pending/telnet.c 1042 1043 struct telnet_data { 1044 int port; 1045 int sfd; 1046 char buff[128]; 1047 int pbuff; 1048 char iac[256]; 1049 int piac; 1050 char *ttype; 1051 struct termios def_term; 1052 struct termios raw_term; 1053 uint8_t term_ok; 1054 uint8_t term_mode; 1055 uint8_t flags; 1056 unsigned win_width; 1057 unsigned win_height; 1058 }; 1059 1060 // toys/pending/telnetd.c 1061 1062 struct telnetd_data { 1063 char *login_path; 1064 char *issue_path; 1065 int port; 1066 char *host_addr; 1067 long w_sec; 1068 1069 int gmax_fd; 1070 pid_t fork_pid; 1071 }; 1072 1073 // toys/pending/tftp.c 1074 1075 struct tftp_data { 1076 char *local_file; 1077 char *remote_file; 1078 long block_size; 1079 1080 struct sockaddr_storage inaddr; 1081 int af; 1082 }; 1083 1084 // toys/pending/tftpd.c 1085 1086 struct tftpd_data { 1087 char *user; 1088 1089 long sfd; 1090 struct passwd *pw; 1091 }; 1092 1093 // toys/pending/tr.c 1094 1095 struct tr_data { 1096 short map[256]; //map of chars 1097 int len1, len2; 1098 }; 1099 1100 // toys/pending/traceroute.c 1101 1102 struct traceroute_data { 1103 long max_ttl; 1104 long port; 1105 long ttl_probes; 1106 char *src_ip; 1107 long tos; 1108 long wait_time; 1109 struct arg_list *loose_source; 1110 long pause_time; 1111 long first_ttl; 1112 char *iface; 1113 1114 uint32_t gw_list[9]; 1115 int recv_sock; 1116 int snd_sock; 1117 unsigned msg_len; 1118 char *packet; 1119 uint32_t ident; 1120 int istraceroute6; 1121 }; 1122 1123 // toys/pending/useradd.c 1124 1125 struct useradd_data { 1126 char *dir; 1127 char *gecos; 1128 char *shell; 1129 char *u_grp; 1130 long uid; 1131 1132 long gid; 1133 }; 1134 1135 // toys/pending/vi.c 1136 1137 struct vi_data { 1138 int cur_col; 1139 int cur_row; 1140 int scr_row; 1141 int drawn_row; 1142 int drawn_col; 1143 unsigned screen_height; 1144 unsigned screen_width; 1145 int vi_mode; 1146 int count0; 1147 int count1; 1148 int vi_mov_flag; 1149 int modified; 1150 char vi_reg; 1151 char *last_search; 1152 int tabstop; 1153 int list; 1154 }; 1155 1156 // toys/pending/wget.c 1157 1158 struct wget_data { 1159 char *p, *O; 1160 long max_redirect; 1161 1162 int sock, https; 1163 char *url; 1164 #if CFG_WGET_LIBTLS 1165 struct tls *tls; 1166 #elif CFG_TOYBOX_LIBCRYPTO 1167 struct ssl_ctx_st *ctx; 1168 struct ssl_st *ssl; 1169 #endif 1170 }; 1171 1172 // toys/posix/basename.c 1173 1174 struct basename_data { 1175 char *s; 1176 }; 1177 1178 // toys/posix/chgrp.c 1179 1180 struct chgrp_data { 1181 uid_t owner; 1182 gid_t group; 1183 char *owner_name, *group_name; 1184 int symfollow; 1185 }; 1186 1187 // toys/posix/chmod.c 1188 1189 struct chmod_data { 1190 char *mode; 1191 }; 1192 1193 // toys/posix/cksum.c 1194 1195 struct cksum_data { 1196 unsigned crc_table[256]; 1197 }; 1198 1199 // toys/posix/cmp.c 1200 1201 struct cmp_data { 1202 long n; 1203 1204 int fd; 1205 char *name; 1206 }; 1207 1208 // toys/posix/cp.c 1209 1210 struct cp_data { 1211 union { 1212 // install's options 1213 struct { 1214 char *g, *o, *m, *t; 1215 } i; 1216 // cp's options 1217 struct { 1218 char *t, *preserve; 1219 } c; 1220 }; 1221 1222 char *destname; 1223 struct stat top; 1224 int (*callback)(struct dirtree *try); 1225 uid_t uid; 1226 gid_t gid; 1227 int pflags; 1228 }; 1229 1230 // toys/posix/cpio.c 1231 1232 struct cpio_data { 1233 char *F, *p, *H; 1234 }; 1235 1236 // toys/posix/cut.c 1237 1238 struct cut_data { 1239 char *d, *O; 1240 struct arg_list *select[5]; // we treat them the same, so loop through 1241 1242 unsigned line; 1243 int pairs; 1244 regex_t reg; 1245 }; 1246 1247 // toys/posix/date.c 1248 1249 struct date_data { 1250 #ifdef TOYBOX_OH_ADAPT 1251 char *r, *d; 1252 #else 1253 char *r, *D, *d; 1254 #endif 1255 unsigned nano; 1256 }; 1257 1258 // toys/posix/df.c 1259 1260 struct df_data { 1261 struct arg_list *t; 1262 1263 long units; 1264 int column_widths[5]; 1265 int header_shown; 1266 }; 1267 1268 // toys/posix/du.c 1269 1270 struct du_data { 1271 long d; 1272 1273 unsigned long depth, total; 1274 dev_t st_dev; 1275 void *inodes; 1276 }; 1277 1278 // toys/posix/env.c 1279 1280 struct env_data { 1281 struct arg_list *u; 1282 };; 1283 1284 // toys/posix/expand.c 1285 1286 struct expand_data { 1287 struct arg_list *t; 1288 1289 unsigned tabcount, *tab; 1290 }; 1291 1292 // toys/posix/file.c 1293 1294 struct file_data { 1295 int max_name_len; 1296 1297 off_t len; 1298 }; 1299 1300 // toys/posix/find.c 1301 1302 struct find_data { 1303 char **filter; 1304 struct double_list *argdata; 1305 int topdir, xdev, depth; 1306 time_t now; 1307 long max_bytes; 1308 char *start; 1309 }; 1310 1311 // toys/posix/grep.c 1312 1313 struct grep_data { 1314 long m, A, B, C; 1315 struct arg_list *f, *e, *M, *S, *exclude_dir; 1316 char *color; 1317 1318 char *purple, *cyan, *red, *green, *grey; 1319 struct double_list *reg; 1320 int found, tried, delim; 1321 struct arg_list *fixed[256]; 1322 }; 1323 1324 // toys/posix/head.c 1325 1326 struct head_data { 1327 long c, n; 1328 1329 int file_no; 1330 }; 1331 1332 // toys/posix/iconv.c 1333 1334 struct iconv_data { 1335 char *f, *t; 1336 1337 void *ic; 1338 }; 1339 1340 // toys/posix/id.c 1341 1342 struct id_data { 1343 int is_groups; 1344 }; 1345 1346 // toys/posix/kill.c 1347 1348 struct kill_data { 1349 char *s; 1350 struct arg_list *o; 1351 }; 1352 1353 // toys/posix/ln.c 1354 1355 struct ln_data { 1356 char *t; 1357 }; 1358 1359 // toys/posix/logger.c 1360 1361 struct logger_data { 1362 char *p, *t; 1363 }; 1364 1365 // toys/posix/ls.c 1366 1367 struct ls_data { 1368 long w, l, block_size; 1369 char *color, *sort; 1370 1371 struct dirtree *files, *singledir; 1372 unsigned screen_width; 1373 int nl_title; 1374 char *escmore; 1375 }; 1376 1377 // toys/posix/mkdir.c 1378 1379 struct mkdir_data { 1380 char *m, *Z; 1381 }; 1382 1383 // toys/posix/mkfifo.c 1384 1385 struct mkfifo_data { 1386 char *m; 1387 char *Z; 1388 1389 mode_t mode; 1390 }; 1391 1392 // toys/posix/nice.c 1393 1394 struct nice_data { 1395 long n; 1396 }; 1397 1398 // toys/posix/nl.c 1399 1400 struct nl_data { 1401 char *s, *n, *b; 1402 long w, l, v; 1403 1404 // Count of consecutive blank lines for -l has to persist between files 1405 long lcount; 1406 long slen; 1407 }; 1408 1409 // toys/posix/od.c 1410 1411 struct od_data { 1412 struct arg_list *t; 1413 char *A; 1414 long N, w, j; 1415 1416 int address_idx; 1417 unsigned types, leftover, star; 1418 char *buf; // Points to buffers[0] or buffers[1]. 1419 char *bufs[2]; // Used to detect duplicate lines. 1420 off_t pos; 1421 }; 1422 1423 // toys/posix/paste.c 1424 1425 struct paste_data { 1426 char *d; 1427 1428 int files; 1429 }; 1430 1431 // toys/posix/patch.c 1432 1433 struct patch_data { 1434 char *i, *d; 1435 long p, g; 1436 1437 struct double_list *current_hunk; 1438 long oldline, oldlen, newline, newlen; 1439 long linenum; 1440 int context, state, filein, fileout, filepatch, hunknum; 1441 char *tempname; 1442 }; 1443 1444 // toys/posix/ps.c 1445 1446 struct ps_data { 1447 union { 1448 struct { 1449 struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k; 1450 } ps; 1451 struct { 1452 long n, m, d, s; 1453 struct arg_list *u, *p, *o, *k, *O; 1454 } top; 1455 struct { 1456 char *L; 1457 struct arg_list *G, *g, *P, *s, *t, *U, *u; 1458 char *d; 1459 1460 void *regexes, *snapshot; 1461 int signal; 1462 pid_t self, match; 1463 } pgrep; 1464 }; 1465 1466 struct ps_ptr_len { 1467 void *ptr; 1468 long len; 1469 } gg, GG, pp, PP, ss, tt, uu, UU; 1470 struct dirtree *threadparent; 1471 unsigned width, height, scroll; 1472 dev_t tty; 1473 void *fields, *kfields; 1474 long long ticks, bits, time; 1475 int kcount, forcek, sortpos, pidlen; 1476 int (*match_process)(long long *slot); 1477 void (*show_process)(void *tb); 1478 }; 1479 1480 // toys/posix/renice.c 1481 1482 struct renice_data { 1483 long n; 1484 }; 1485 1486 // toys/posix/sed.c 1487 1488 struct sed_data { 1489 char *i; 1490 struct arg_list *f, *e; 1491 1492 // processed pattern list 1493 struct double_list *pattern; 1494 1495 char *nextline, *remember; 1496 void *restart, *lastregex; 1497 long nextlen, rememberlen, count; 1498 int fdout, noeol; 1499 unsigned xx; 1500 char delim; 1501 }; 1502 1503 // toys/posix/sort.c 1504 1505 struct sort_data { 1506 char *t; 1507 struct arg_list *k; 1508 char *o, *T, S; 1509 1510 void *key_list; 1511 int linecount; 1512 char **lines, *name; 1513 }; 1514 1515 // toys/posix/split.c 1516 1517 struct split_data { 1518 long n, l, b, a; 1519 1520 char *outfile; 1521 }; 1522 1523 // toys/posix/strings.c 1524 1525 struct strings_data { 1526 long n; 1527 char *t; 1528 }; 1529 1530 // toys/posix/tail.c 1531 1532 struct tail_data { 1533 long n, c; 1534 1535 int file_no, last_fd; 1536 struct xnotify *not; 1537 }; 1538 1539 // toys/posix/tar.c 1540 1541 struct tar_data { 1542 char *f, *C; 1543 struct arg_list *T, *X; 1544 char *to_command, *owner, *group, *mtime, *mode; 1545 struct arg_list *exclude; 1546 1547 struct double_list *incl, *excl, *seen; 1548 struct string_list *dirs; 1549 char *cwd; 1550 int fd, ouid, ggid, hlc, warn, adev, aino, sparselen; 1551 long long *sparse; 1552 time_t mtt; 1553 1554 // hardlinks seen so far (hlc many) 1555 struct { 1556 char *arg; 1557 ino_t ino; 1558 dev_t dev; 1559 } *hlx; 1560 1561 // Parsed information about a tar header. 1562 struct tar_header { 1563 char *name, *link_target, *uname, *gname; 1564 long long size, ssize; 1565 uid_t uid; 1566 gid_t gid; 1567 mode_t mode; 1568 time_t mtime; 1569 dev_t device; 1570 } hdr; 1571 }; 1572 1573 // toys/posix/tee.c 1574 1575 struct tee_data { 1576 void *outputs; 1577 int out; 1578 }; 1579 1580 // toys/posix/touch.c 1581 1582 struct touch_data { 1583 char *t, *r, *d; 1584 }; 1585 1586 // toys/posix/ulimit.c 1587 1588 struct ulimit_data { 1589 long P; 1590 }; 1591 1592 // toys/posix/uniq.c 1593 1594 struct uniq_data { 1595 long w, s, f; 1596 1597 long repeats; 1598 }; 1599 1600 // toys/posix/uudecode.c 1601 1602 struct uudecode_data { 1603 char *o; 1604 }; 1605 1606 // toys/posix/wc.c 1607 1608 struct wc_data { 1609 unsigned long totals[4]; 1610 }; 1611 1612 // toys/posix/xargs.c 1613 1614 struct xargs_data { 1615 long s, n, P; 1616 char *E; 1617 1618 long entries, bytes; 1619 char delim; 1620 FILE *tty; 1621 }; 1622 1623 extern union global_union { 1624 struct log_data log; 1625 struct demo_number_data demo_number; 1626 struct hello_data hello; 1627 struct skeleton_data skeleton; 1628 struct dmesg_data dmesg; 1629 struct gzip_data gzip; 1630 struct hostname_data hostname; 1631 struct killall_data killall; 1632 struct md5sum_data md5sum; 1633 struct mknod_data mknod; 1634 struct mktemp_data mktemp; 1635 struct mount_data mount; 1636 struct passwd_data passwd; 1637 struct pidof_data pidof; 1638 struct seq_data seq; 1639 #ifdef OHOS_LITE 1640 struct su_data su; 1641 #endif 1642 struct umount_data umount; 1643 struct ftpget_data ftpget; 1644 struct ifconfig_data ifconfig; 1645 struct microcom_data microcom; 1646 struct netcat_data netcat; 1647 struct netstat_data netstat; 1648 struct ping_data ping; 1649 struct sntp_data sntp; 1650 struct tunctl_data tunctl; 1651 struct acpi_data acpi; 1652 struct base64_data base64; 1653 struct blkid_data blkid; 1654 struct blockdev_data blockdev; 1655 struct chrt_data chrt; 1656 struct dos2unix_data dos2unix; 1657 struct fallocate_data fallocate; 1658 struct fmt_data fmt; 1659 struct free_data free; 1660 struct hexedit_data hexedit; 1661 struct hwclock_data hwclock; 1662 struct ionice_data ionice; 1663 struct login_data login; 1664 struct losetup_data losetup; 1665 struct lspci_data lspci; 1666 struct makedevs_data makedevs; 1667 struct mix_data mix; 1668 struct mkpasswd_data mkpasswd; 1669 struct mkswap_data mkswap; 1670 struct modinfo_data modinfo; 1671 struct nsenter_data nsenter; 1672 struct oneit_data oneit; 1673 struct pwgen_data pwgen; 1674 struct reboot_data reboot; 1675 struct setfattr_data setfattr; 1676 struct sha3sum_data sha3sum; 1677 struct shred_data shred; 1678 struct stat_data stat; 1679 struct swapon_data swapon; 1680 struct switch_root_data switch_root; 1681 struct tac_data tac; 1682 struct timeout_data timeout; 1683 struct truncate_data truncate; 1684 struct watch_data watch; 1685 struct xxd_data xxd; 1686 struct arp_data arp; 1687 struct arping_data arping; 1688 struct bc_data bc; 1689 struct bootchartd_data bootchartd; 1690 struct brctl_data brctl; 1691 struct chsh_data chsh; 1692 struct crond_data crond; 1693 struct crontab_data crontab; 1694 struct dd_data dd; 1695 struct dhcp_data dhcp; 1696 struct dhcp6_data dhcp6; 1697 struct dhcpd_data dhcpd; 1698 struct diff_data diff; 1699 struct dumpleases_data dumpleases; 1700 struct expr_data expr; 1701 struct fdisk_data fdisk; 1702 struct fold_data fold; 1703 struct fsck_data fsck; 1704 struct getfattr_data getfattr; 1705 struct getopt_data getopt; 1706 struct getty_data getty; 1707 struct groupadd_data groupadd; 1708 struct hexdump_data hexdump; 1709 struct host_data host; 1710 struct ip_data ip; 1711 struct ipcrm_data ipcrm; 1712 struct ipcs_data ipcs; 1713 struct klogd_data klogd; 1714 struct last_data last; 1715 struct lsof_data lsof; 1716 struct man_data man; 1717 struct mke2fs_data mke2fs; 1718 struct modprobe_data modprobe; 1719 struct more_data more; 1720 struct openvt_data openvt; 1721 struct route_data route; 1722 struct sh_data sh; 1723 struct strace_data strace; 1724 struct stty_data stty; 1725 struct sulogin_data sulogin; 1726 struct syslogd_data syslogd; 1727 struct tcpsvd_data tcpsvd; 1728 struct telnet_data telnet; 1729 struct telnetd_data telnetd; 1730 struct tftp_data tftp; 1731 struct tftpd_data tftpd; 1732 struct tr_data tr; 1733 struct traceroute_data traceroute; 1734 struct useradd_data useradd; 1735 struct vi_data vi; 1736 struct awk_data awk; 1737 struct wget_data wget; 1738 struct basename_data basename; 1739 struct chgrp_data chgrp; 1740 struct chmod_data chmod; 1741 struct cksum_data cksum; 1742 struct cmp_data cmp; 1743 struct cp_data cp; 1744 struct cpio_data cpio; 1745 struct cut_data cut; 1746 struct date_data date; 1747 struct df_data df; 1748 struct du_data du; 1749 struct env_data env; 1750 struct expand_data expand; 1751 struct file_data file; 1752 struct find_data find; 1753 struct grep_data grep; 1754 struct head_data head; 1755 struct iconv_data iconv; 1756 struct id_data id; 1757 struct kill_data kill; 1758 struct ln_data ln; 1759 struct logger_data logger; 1760 struct ls_data ls; 1761 struct mkdir_data mkdir; 1762 struct mkfifo_data mkfifo; 1763 struct nice_data nice; 1764 struct nl_data nl; 1765 struct od_data od; 1766 struct paste_data paste; 1767 struct patch_data patch; 1768 struct ps_data ps; 1769 struct renice_data renice; 1770 struct sed_data sed; 1771 struct sort_data sort; 1772 struct split_data split; 1773 struct strings_data strings; 1774 struct tail_data tail; 1775 struct tar_data tar; 1776 struct tee_data tee; 1777 struct touch_data touch; 1778 struct ulimit_data ulimit; 1779 struct uniq_data uniq; 1780 struct uudecode_data uudecode; 1781 struct wc_data wc; 1782 struct xargs_data xargs; 1783 } this; 1784