1 struct gzip_data { 2 int level; 3 }; 4 5 struct hostname_data { 6 char *F; 7 }; 8 9 struct md5sum_data { 10 int sawline; 11 }; 12 13 struct mktemp_data { 14 char *p, *tmpdir; 15 }; 16 17 struct mount_data { 18 struct arg_list *o; 19 char *t, *O; 20 21 unsigned long flags; 22 char *opts; 23 int okuser; 24 }; 25 26 struct seq_data { 27 char *s, *f; 28 29 int precision, buflen; 30 }; 31 32 struct umount_data { 33 struct arg_list *t; 34 35 char *types; 36 }; 37 38 struct microcom_data { 39 long s; 40 41 int fd, stok; 42 struct termios old_stdin, old_fd; 43 }; 44 45 struct dos2unix_data { 46 char *tempfile; 47 }; 48 49 struct getopt_data { 50 struct arg_list *l; 51 char *o, *n; 52 }; 53 54 struct nsenter_data { 55 char *UupnmiC[7]; 56 long t; 57 }; 58 59 struct realpath_data { 60 char *R, *relative_base; 61 }; 62 63 struct setsid_data { 64 long c; 65 }; 66 67 struct stat_data { 68 char *c; 69 70 union { 71 struct stat st; 72 struct statfs sf; 73 } stat; 74 char *file, *pattern; 75 int patlen; 76 }; 77 78 struct timeout_data { 79 char *s, *k; 80 81 struct pollfd pfd; 82 sigjmp_buf sj; 83 int fds[2], pid, rc; 84 }; 85 86 struct truncate_data { 87 char *s; 88 89 long long size; 90 int type; 91 }; 92 93 struct xxd_data { 94 long s, g, o, l, c; 95 }; 96 97 struct diff_data { 98 long U; 99 struct arg_list *L; 100 char *F, *S, *new_line_format, *old_line_format, *unchanged_line_format; 101 102 int dir_num, size, is_binary, is_symlink, differ, change, len[2], *offset[2]; 103 struct stat st[2]; 104 struct { 105 char **list; 106 int nr_elm; 107 } dir[2]; 108 struct { 109 FILE *fp; 110 int len; 111 } file[2]; 112 struct { 113 char *name; 114 int len; 115 } link[2]; 116 }; 117 118 struct expr_data { 119 char **tok, *delete; 120 }; 121 122 struct tr_data { 123 short *map; 124 int len1, len2; 125 }; 126 127 struct basename_data { 128 char *s; 129 }; 130 131 struct chmod_data { 132 char *mode; 133 }; 134 135 struct cmp_data { 136 long n; 137 138 int fd; 139 char *name; 140 }; 141 142 struct cp_data { 143 union { 144 // install's options 145 struct { 146 char *g, *o, *m, *t; 147 } i; 148 // cp's options 149 struct { 150 char *t, *preserve; 151 } c; 152 }; 153 154 char *destname; 155 struct stat top; 156 int (*callback)(struct dirtree *try); 157 uid_t uid; 158 gid_t gid; 159 int pflags; 160 }; 161 162 struct cpio_data { 163 char *F, *H, *R; 164 }; 165 166 struct cut_data { 167 char *d, *O; 168 struct arg_list *select[5]; // we treat them the same, so loop through 169 170 unsigned line; 171 int pairs; 172 regex_t reg; 173 }; 174 175 struct date_data { 176 char *s, *r, *I, *D, *d; 177 178 unsigned nano; 179 }; 180 181 struct dd_data { 182 // Display fields 183 int show_xfer, show_records; 184 unsigned long long bytes, in_full, in_part, out_full, out_part, start; 185 }; 186 187 struct du_data { 188 long d; 189 190 unsigned long depth, total; 191 dev_t st_dev; 192 void *inodes; 193 }; 194 195 struct env_data { 196 struct arg_list *u; 197 char *e; 198 }; 199 200 struct file_data { 201 int max_name_len; 202 off_t len; 203 }; 204 205 struct find_data { 206 char **filter; 207 struct double_list *argdata; 208 int topdir, xdev, depth; 209 time_t now; 210 long max_bytes; 211 char *start; 212 }; 213 214 struct grep_data { 215 long m, A, B, C; 216 struct arg_list *f, *e, *M, *S, *exclude_dir; 217 char *color; 218 219 char *purple, *cyan, *red, *green, *grey; 220 struct double_list *reg; 221 int found, tried, delim; 222 struct arg_list **fixed; 223 }; 224 225 struct head_data { 226 long c, n; 227 228 int file_no; 229 }; 230 231 struct id_data { 232 int is_groups; 233 }; 234 235 struct ln_data { 236 char *t; 237 }; 238 239 struct ls_data { 240 long w, l, block_size; 241 char *color, *sort; 242 243 struct dirtree *files, *singledir; 244 unsigned screen_width; 245 int nl_title; 246 char *escmore; 247 }; 248 249 struct mkdir_data { 250 char *m, *Z; 251 }; 252 253 struct nl_data { 254 char *s, *n, *b; 255 long w, l, v; 256 257 // Count of consecutive blank lines for -l has to persist between files 258 long lcount, slen; 259 }; 260 261 struct od_data { 262 struct arg_list *t; 263 char *A; 264 long N, w, j; 265 266 int address_idx; 267 unsigned types, leftover, star; 268 char *buf; // Points to buffers[0] or buffers[1]. 269 char *bufs[2]; // Used to detect duplicate lines. 270 off_t pos; 271 }; 272 273 struct paste_data { 274 char *d; 275 276 int files; 277 }; 278 279 struct patch_data { 280 char *i, *d; 281 long v, p, g, F; 282 283 void *current_hunk; 284 long oldline, oldlen, newline, newlen, linenum, outnum; 285 int context, state, filein, fileout, filepatch, hunknum; 286 char *tempname; 287 }; 288 289 struct ps_data { 290 union { 291 struct { 292 struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k; 293 } ps; 294 struct { 295 long n, m, d, s; 296 struct arg_list *u, *p, *o, *k, *O; 297 } top; 298 struct { 299 char *L; 300 struct arg_list *G, *g, *P, *s, *t, *U, *u; 301 char *d; 302 303 void *regexes, *snapshot; 304 int signal; 305 pid_t self, match; 306 } pgrep; 307 }; 308 309 struct ps_ptr_len { 310 void *ptr; 311 long len; 312 } gg, GG, pp, PP, ss, tt, uu, UU; 313 struct dirtree *threadparent; 314 unsigned width, height, scroll; 315 dev_t tty; 316 void *fields, *kfields; 317 long long ticks, bits, time; 318 int kcount, forcek, sortpos, pidlen; 319 int (*match_process)(long long *slot); 320 void (*show_process)(void *tb); 321 }; 322 323 struct sed_data { 324 char *i; 325 struct arg_list *f, *e; 326 327 // processed pattern list 328 struct double_list *pattern; 329 330 char *nextline, *remember, *tarxform; 331 void *restart, *lastregex; 332 long nextlen, rememberlen, count; 333 int fdout, noeol; 334 unsigned xx, tarxlen, xflags; 335 char delim, xftype; 336 }; 337 338 struct sort_data { 339 char *t; 340 struct arg_list *k; 341 char *o, *T, S; 342 343 void *key_list; 344 unsigned linecount; 345 char **lines, *name; 346 }; 347 348 struct tail_data { 349 long n, c; 350 char *s; 351 352 int file_no, last_fd, ss; 353 struct xnotify *not; 354 struct { 355 char *path; 356 int fd; 357 struct dev_ino di; 358 } *F; 359 }; 360 361 struct tar_data { 362 char *f, *C, *I; 363 struct arg_list *T, *X, *xform; 364 long strip; 365 char *to_command, *owner, *group, *mtime, *mode, *sort; 366 struct arg_list *exclude; 367 368 struct double_list *incl, *excl, *seen; 369 struct string_list *dirs; 370 char *cwd, **xfsed; 371 int fd, ouid, ggid, hlc, warn, sparselen, pid, xfpipe[2]; 372 struct dev_ino archive_di; 373 long long *sparse; 374 time_t mtt; 375 376 // hardlinks seen so far (hlc many) 377 struct { 378 char *arg; 379 struct dev_ino di; 380 } *hlx; 381 382 // Parsed information about a tar header. 383 struct tar_header { 384 char *name, *link_target, *uname, *gname; 385 long long size, ssize, oldsparse; 386 uid_t uid; 387 gid_t gid; 388 mode_t mode; 389 time_t mtime; 390 dev_t device; 391 } hdr; 392 }; 393 394 struct tee_data { 395 void *outputs; 396 int out; 397 }; 398 399 struct touch_data { 400 char *t, *r, *d; 401 }; 402 403 struct uniq_data { 404 long w, s, f; 405 406 long repeats; 407 }; 408 409 struct wc_data { 410 unsigned long totals[5]; 411 }; 412 413 struct xargs_data { 414 long s, n, P; 415 char *E; 416 417 long entries, bytes, np; 418 char delim; 419 FILE *tty; 420 }; 421 extern union global_union { 422 struct gzip_data gzip; 423 struct hostname_data hostname; 424 struct md5sum_data md5sum; 425 struct mktemp_data mktemp; 426 struct mount_data mount; 427 struct seq_data seq; 428 struct umount_data umount; 429 struct microcom_data microcom; 430 struct dos2unix_data dos2unix; 431 struct getopt_data getopt; 432 struct nsenter_data nsenter; 433 struct realpath_data realpath; 434 struct setsid_data setsid; 435 struct stat_data stat; 436 struct timeout_data timeout; 437 struct truncate_data truncate; 438 struct xxd_data xxd; 439 struct diff_data diff; 440 struct expr_data expr; 441 struct tr_data tr; 442 struct basename_data basename; 443 struct chmod_data chmod; 444 struct cmp_data cmp; 445 struct cp_data cp; 446 struct cpio_data cpio; 447 struct cut_data cut; 448 struct date_data date; 449 struct dd_data dd; 450 struct du_data du; 451 struct env_data env; 452 struct file_data file; 453 struct find_data find; 454 struct grep_data grep; 455 struct head_data head; 456 struct id_data id; 457 struct ln_data ln; 458 struct ls_data ls; 459 struct mkdir_data mkdir; 460 struct nl_data nl; 461 struct od_data od; 462 struct paste_data paste; 463 struct patch_data patch; 464 struct ps_data ps; 465 struct sed_data sed; 466 struct sort_data sort; 467 struct tail_data tail; 468 struct tar_data tar; 469 struct tee_data tee; 470 struct touch_data touch; 471 struct uniq_data uniq; 472 struct wc_data wc; 473 struct xargs_data xargs; 474 } this; 475