globals.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. struct gzip_data {
  2. int level;
  3. };
  4. struct realpath_data {
  5. char *R, *relative_base;
  6. };
  7. struct tr_data {
  8. short *map;
  9. int len1, len2;
  10. };
  11. struct basename_data {
  12. char *s;
  13. };
  14. struct chmod_data {
  15. char *mode;
  16. };
  17. struct cmp_data {
  18. long n;
  19. int fd;
  20. char *name;
  21. };
  22. struct fold_data {
  23. long w;
  24. };
  25. struct grep_data {
  26. long m, A, B, C;
  27. struct arg_list *f, *e, *M, *S, *exclude_dir;
  28. char *color;
  29. char *purple, *cyan, *red, *green, *grey;
  30. struct double_list *reg;
  31. int found, tried, delim;
  32. struct arg_list **fixed;
  33. };
  34. struct head_data {
  35. long c, n;
  36. int file_no;
  37. };
  38. struct ln_data {
  39. char *t;
  40. };
  41. struct ls_data {
  42. long w, l, block_size;
  43. char *color, *sort;
  44. struct dirtree *files, *singledir;
  45. unsigned screen_width;
  46. int nl_title;
  47. char *escmore;
  48. };
  49. struct mkdir_data {
  50. char *m, *Z;
  51. };
  52. struct od_data {
  53. struct arg_list *t;
  54. char *A;
  55. long N, w, j;
  56. int address_idx;
  57. unsigned types, leftover, star;
  58. char *buf; // Points to buffers[0] or buffers[1].
  59. char *bufs[2]; // Used to detect duplicate lines.
  60. off_t pos;
  61. };
  62. struct sed_data {
  63. char *i;
  64. struct arg_list *f, *e;
  65. // processed pattern list
  66. struct double_list *pattern;
  67. char *nextline, *remember, *tarxform;
  68. void *restart, *lastregex;
  69. long nextlen, rememberlen, count;
  70. int fdout, noeol;
  71. unsigned xx, tarxlen, xflags;
  72. char delim, xftype;
  73. };
  74. struct sort_data {
  75. char *t;
  76. struct arg_list *k;
  77. char *o, *T, S;
  78. void *key_list;
  79. unsigned linecount;
  80. char **lines, *name;
  81. };
  82. struct tail_data {
  83. long n, c;
  84. char *s;
  85. int file_no, last_fd, ss;
  86. struct xnotify *not;
  87. struct {
  88. char *path;
  89. int fd;
  90. struct dev_ino di;
  91. } *F;
  92. };
  93. struct tee_data {
  94. void *outputs;
  95. int out;
  96. };
  97. struct wc_data {
  98. unsigned long totals[5];
  99. };
  100. struct xargs_data {
  101. long s, n, P;
  102. char *E, *a;
  103. long entries, bytes, np;
  104. char delim;
  105. FILE *tty;
  106. };
  107. extern union global_union {
  108. struct gzip_data gzip;
  109. struct realpath_data realpath;
  110. struct tr_data tr;
  111. struct basename_data basename;
  112. struct chmod_data chmod;
  113. struct cmp_data cmp;
  114. struct fold_data fold;
  115. struct grep_data grep;
  116. struct head_data head;
  117. struct ln_data ln;
  118. struct ls_data ls;
  119. struct mkdir_data mkdir;
  120. struct od_data od;
  121. struct sed_data sed;
  122. struct sort_data sort;
  123. struct tail_data tail;
  124. struct tee_data tee;
  125. struct wc_data wc;
  126. struct xargs_data xargs;
  127. } this;