• Home
  • Raw
  • Download

Lines Matching refs:shf

30 static void ptree(struct op *, int, struct shf *);
31 static void pioact(struct shf *, struct ioword *);
32 static const char *wdvarput(struct shf *, const char *, int, int);
33 static void vfptreef(struct shf *, int, const char *, va_list);
46 ptree(struct op *t, int indent, struct shf *shf) in ptree() argument
77 fptreef(shf, indent, Tf_S, t->vars[0]); in ptree()
84 fptreef(shf, indent, Tf_S_, *w++); in ptree()
86 shf_puts("#no-vars# ", shf); in ptree()
93 shf_putc('\\', shf); in ptree()
94 shf_puts(cp, shf); in ptree()
95 shf_putc(' ', shf); in ptree()
99 fptreef(shf, indent, Tf_S_, *w++); in ptree()
101 shf_puts("#no-args# ", shf); in ptree()
107 fptreef(shf, indent + 2, "( %T) ", t->left); in ptree()
110 fptreef(shf, indent, "%T| ", t->left); in ptree()
114 fptreef(shf, indent, "%T%;", t->left); in ptree()
119 fptreef(shf, indent, "%T%s %T", in ptree()
123 shf_puts("! ", shf); in ptree()
129 shf_puts("[[", shf); in ptree()
131 fptreef(shf, indent, Tf__S, *w++); in ptree()
132 shf_puts(" ]] ", shf); in ptree()
136 fptreef(shf, indent, "%s %s ", in ptree()
139 shf_puts("in ", shf); in ptree()
142 fptreef(shf, indent, Tf_S_, *w++); in ptree()
143 fptreef(shf, indent, Tft_end); in ptree()
145 fptreef(shf, indent + INDENT, "do%N%T", t->left); in ptree()
146 fptreef(shf, indent, "%;done "); in ptree()
149 fptreef(shf, indent, "case %S in", t->str); in ptree()
151 fptreef(shf, indent, "%N("); in ptree()
154 fptreef(shf, indent, "%S%c", *w, in ptree()
158 fptreef(shf, indent + INDENT, "%N%T%N;%c", t1->left, in ptree()
161 fptreef(shf, indent, "%Nesac "); in ptree()
173 fptreef(shf, indent, Tft_end); in ptree()
176 fptreef(shf, indent + 5 - i, Telif_pT + i, t1->left); in ptree()
179 fptreef(shf, indent, Tft_end); in ptree()
180 fptreef(shf, indent + INDENT, "%s%N%T", in ptree()
185 fptreef(shf, indent, Tft_end); in ptree()
186 fptreef(shf, indent + INDENT, "%s%N%T", in ptree()
189 fptreef(shf, indent, "%;fi "); in ptree()
194 fptreef(shf, indent + 6, Tf_s_T, in ptree()
197 fptreef(shf, indent, Tft_end); in ptree()
198 fptreef(shf, indent + INDENT, "do%N%T", t->right); in ptree()
199 fptreef(shf, indent, "%;done "); in ptree()
202 fptreef(shf, indent + INDENT, "{%N%T", t->left); in ptree()
203 fptreef(shf, indent, "%;} "); in ptree()
206 fptreef(shf, indent, "%T|& ", t->left); in ptree()
210 fptreef(shf, indent, "%T& ", t->left); in ptree()
214 fpFUNCTf(shf, indent, tobool(t->u.ksh_func), t->str, t->left); in ptree()
217 fptreef(shf, indent, Tf_s_T, Ttime, t->left); in ptree()
220 shf_puts("<botch>", shf); in ptree()
228 pioact(shf, *ioact++); in ptree()
237 shf_putc('\n', shf); in ptree()
238 shf_puts(iop->heredoc, shf); in ptree()
239 fptreef(shf, indent, Tf_s, in ptree()
250 shf_putc('\n', shf); in ptree()
257 pioact(struct shf *shf, struct ioword *iop) in pioact() argument
268 shf_fprintf(shf, Tf_d, (int)iop->unit); in pioact()
272 shf_putc('<', shf); in pioact()
275 shf_puts("<<", shf); in pioact()
277 shf_putc('-', shf); in pioact()
279 shf_putc('<', shf); in pioact()
282 shf_puts(">>", shf); in pioact()
285 shf_putc('>', shf); in pioact()
287 shf_putc('|', shf); in pioact()
290 shf_puts("<>", shf); in pioact()
293 shf_puts(flag & IORDUP ? "<&" : ">&", shf); in pioact()
299 wdvarput(shf, iop->delim, 0, WDS_TPUTS); in pioact()
302 print_value_quoted(shf, iop->ioname); in pioact()
304 wdvarput(shf, iop->ioname, 0, WDS_TPUTS); in pioact()
306 shf_putc(' ', shf); in pioact()
312 wdvarput(struct shf *shf, const char *wp, int quotelevel, int opmode) in wdvarput() argument
339 shf_putc(c, shf); in wdvarput()
348 shf_putc(c, shf); in wdvarput()
349 shf_putc('\n', shf); in wdvarput()
359 shf_putc('\\', shf); in wdvarput()
362 shf_putc(c, shf); in wdvarput()
366 shf_puts("$(", shf); in wdvarput()
369 shf_putc(' ', shf); in wdvarput()
372 shf_putc(c, shf); in wdvarput()
373 shf_puts(cs, shf); in wdvarput()
382 shf_putc('$', shf); in wdvarput()
383 shf_putc('{', shf); in wdvarput()
384 shf_putc(c, shf); in wdvarput()
388 shf_puts("$((", shf); in wdvarput()
394 shf_putc('"', shf); in wdvarput()
401 shf_putc('"', shf); in wdvarput()
405 shf_putc('$', shf); in wdvarput()
407 shf_putc('{', shf); in wdvarput()
409 shf_putc(c, shf); in wdvarput()
410 wp = wdvarput(shf, wp, 0, opmode); in wdvarput()
415 shf_putc('}', shf); in wdvarput()
419 shf_putchar(*wp++, shf); in wdvarput()
420 shf_putc('(', shf); in wdvarput()
428 shf_putc(c, shf); in wdvarput()
439 fptreef(struct shf *shf, int indent, const char *fmt, ...) in fptreef() argument
444 vfptreef(shf, indent, fmt, va); in fptreef()
453 struct shf shf; in snptreef() local
455 shf_sopen(s, n, SHF_WR | (s ? 0 : SHF_DYNAMIC), &shf); in snptreef()
458 vfptreef(&shf, 0, fmt, va); in snptreef()
462 return (shf_sclose(&shf)); in snptreef()
466 vfptreef(struct shf *shf, int indent, const char *fmt, va_list va) in vfptreef() argument
475 shf_putchar(va_arg(va, int), shf); in vfptreef()
479 shf_puts(va_arg(va, char *), shf); in vfptreef()
483 wdvarput(shf, va_arg(va, char *), 0, WDS_TPUTS); in vfptreef()
487 shf_fprintf(shf, Tf_d, va_arg(va, int)); in vfptreef()
491 shf_fprintf(shf, "%u", va_arg(va, unsigned int)); in vfptreef()
495 ptree(va_arg(va, struct op *), indent, shf); in vfptreef()
501 if (shf->flags & SHF_STRING) { in vfptreef()
503 shf_putc(';', shf); in vfptreef()
504 shf_putc(' ', shf); in vfptreef()
508 shf_putc('\n', shf); in vfptreef()
511 shf_putc('\t', shf); in vfptreef()
515 shf_putc(' ', shf); in vfptreef()
520 pioact(shf, va_arg(va, struct ioword *)); in vfptreef()
523 shf_putc(c, shf); in vfptreef()
527 shf_putc(c, shf); in vfptreef()
672 struct shf shf; in wdstrip() local
674 shf_sopen(NULL, 32, SHF_WR | SHF_DYNAMIC, &shf); in wdstrip()
675 wdvarput(&shf, wp, 0, opmode); in wdstrip()
677 return (shf_sclose(&shf)); in wdstrip()
765 fpFUNCTf(struct shf *shf, int i, bool isksh, const char *k, struct op *v) in fpFUNCTf() argument
768 fptreef(shf, i, "%s %s %T", Tfunction, k, v); in fpFUNCTf()
770 fptreef(shf, i, "%s %s() %T", Tfunction, k, v); in fpFUNCTf()
772 fptreef(shf, i, "%s() %T", k, v); in fpFUNCTf()
823 dumpchar(struct shf *shf, int c) in dumpchar() argument
827 shf_putc((c & 0x80) ? '$' : '^', shf); in dumpchar()
830 shf_putc(c, shf); in dumpchar()
835 dumpwdvar_i(struct shf *shf, const char *wp, int quotelevel) in dumpwdvar_i() argument
842 shf_puts("EOS", shf); in dumpwdvar_i()
846 shf_puts(/*{*/ "]ADELIM(})", shf); in dumpwdvar_i()
849 shf_puts("ADELIM=", shf); in dumpwdvar_i()
853 shf_puts("CHAR=", shf); in dumpwdvar_i()
854 dumpchar(shf, *wp++); in dumpwdvar_i()
857 shf_puts("QCHAR<", shf); in dumpwdvar_i()
861 shf_putc('\\', shf); in dumpwdvar_i()
862 dumpchar(shf, c); in dumpwdvar_i()
865 shf_puts("COMASUB<", shf); in dumpwdvar_i()
868 shf_puts("COMSUB<", shf); in dumpwdvar_i()
871 dumpchar(shf, c); in dumpwdvar_i()
873 shf_putc('>', shf); in dumpwdvar_i()
876 shf_puts("FUNASUB<", shf); in dumpwdvar_i()
879 shf_puts("FUNSUB<", shf); in dumpwdvar_i()
882 shf_puts("VALSUB<", shf); in dumpwdvar_i()
885 shf_puts("EXPRSUB<", shf); in dumpwdvar_i()
888 shf_fprintf(shf, "OQUOTE{%d" /*}*/, ++quotelevel); in dumpwdvar_i()
891 shf_fprintf(shf, /*{*/ "%d}CQUOTE", quotelevel); in dumpwdvar_i()
895 shf_puts("(err)", shf); in dumpwdvar_i()
898 shf_puts("OSUBST(", shf); in dumpwdvar_i()
899 dumpchar(shf, *wp++); in dumpwdvar_i()
900 shf_puts(")[", shf); in dumpwdvar_i()
902 dumpchar(shf, c); in dumpwdvar_i()
903 shf_putc('|', shf); in dumpwdvar_i()
904 wp = dumpwdvar_i(shf, wp, 0); in dumpwdvar_i()
907 shf_puts("]CSUBST(", shf); in dumpwdvar_i()
908 dumpchar(shf, *wp++); in dumpwdvar_i()
909 shf_putc(')', shf); in dumpwdvar_i()
912 shf_puts("OPAT=", shf); in dumpwdvar_i()
913 dumpchar(shf, *wp++); in dumpwdvar_i()
916 shf_puts("SPAT", shf); in dumpwdvar_i()
919 shf_puts("CPAT", shf); in dumpwdvar_i()
922 shf_fprintf(shf, "INVAL<%u>", (uint8_t)wp[-1]); in dumpwdvar_i()
925 shf_putc(' ', shf); in dumpwdvar_i()
929 dumpwdvar(struct shf *shf, const char *wp) in dumpwdvar() argument
931 dumpwdvar_i(shf, wp, 0); in dumpwdvar()
935 dumpioact(struct shf *shf, struct op *t) in dumpioact() argument
942 shf_puts("{IOACT", shf); in dumpioact()
945 #define DT(x) case x: shf_puts(#x, shf); break; in dumpioact()
946 #define DB(x) if (iop->ioflag & x) shf_puts("|" #x, shf); in dumpioact()
948 shf_putc(';', shf); in dumpioact()
957 shf_fprintf(shf, "unk%d", type); in dumpioact()
967 shf_fprintf(shf, ",unit=%d", (int)iop->unit); in dumpioact()
969 shf_puts(",delim<", shf); in dumpioact()
970 dumpwdvar(shf, iop->delim); in dumpioact()
971 shf_putc('>', shf); in dumpioact()
975 shf_puts(",name=", shf); in dumpioact()
976 print_value_quoted(shf, iop->ioname); in dumpioact()
978 shf_puts(",name<", shf); in dumpioact()
979 dumpwdvar(shf, iop->ioname); in dumpioact()
980 shf_putc('>', shf); in dumpioact()
984 shf_puts(",heredoc=", shf); in dumpioact()
985 print_value_quoted(shf, iop->heredoc); in dumpioact()
990 shf_putc('}', shf); in dumpioact()
994 dumptree(struct shf *shf, struct op *t) in dumptree() argument
1002 shf_putc('\t', shf); in dumptree()
1004 shf_puts("{tree:" /*}*/, shf); in dumptree()
1009 dumpioact(shf, t); in dumptree()
1011 #define OPEN(x) case x: name = #x; shf_puts(" {" #x ":", shf); /*}*/ in dumptree()
1018 shf_putc('\n', shf); in dumptree()
1020 shf_putc('\t', shf); in dumptree()
1021 shf_fprintf(shf, " var%d<", i++); in dumptree()
1022 dumpwdvar(shf, *w++); in dumptree()
1023 shf_putc('>', shf); in dumptree()
1026 shf_puts(" #no-vars#", shf); in dumptree()
1031 shf_putc('\n', shf); in dumptree()
1033 shf_putc('\t', shf); in dumptree()
1034 shf_fprintf(shf, " arg%d<", i++); in dumptree()
1035 dumpwdvar(shf, *w++); in dumptree()
1036 shf_putc('>', shf); in dumptree()
1039 shf_puts(" #no-args#", shf); in dumptree()
1045 shf_putc('\n', shf); in dumptree()
1046 dumptree(shf, t); in dumptree()
1052 shf_putc('\n', shf); in dumptree()
1053 dumptree(shf, t->left); in dumptree()
1055 shf_fprintf(shf, "/%s:", name); in dumptree()
1071 shf_putc('\n', shf); in dumptree()
1073 shf_putc('\t', shf); in dumptree()
1074 shf_fprintf(shf, " arg%d<", i++); in dumptree()
1075 dumpwdvar(shf, *w++); in dumptree()
1076 shf_putc('>', shf); in dumptree()
1081 shf_fprintf(shf, " str<%s>", t->str); in dumptree()
1086 shf_putc('\n', shf); in dumptree()
1088 shf_putc('\t', shf); in dumptree()
1089 shf_fprintf(shf, " var%d<", i++); in dumptree()
1090 dumpwdvar(shf, *w++); in dumptree()
1091 shf_putc('>', shf); in dumptree()
1098 shf_fprintf(shf, " str<%s>", t->str); in dumptree()
1101 shf_putc('\n', shf); in dumptree()
1103 shf_putc('\t', shf); in dumptree()
1104 shf_fprintf(shf, " sub%d[(", i); in dumptree()
1107 dumpwdvar(shf, *w); in dumptree()
1109 shf_putc('|', shf); in dumptree()
1112 shf_putc(')', shf); in dumptree()
1113 dumpioact(shf, t); in dumptree()
1114 shf_putc('\n', shf); in dumptree()
1115 dumptree(shf, t1->left); in dumptree()
1116 shf_fprintf(shf, " ;%c/%d]", t1->u.charflag, i++); in dumptree()
1130 shf_fprintf(shf, " str<%s> ksh<%s>", t->str, in dumptree()
1137 shf_putc('\n', shf); in dumptree()
1138 dumptree(shf, t->left); in dumptree()
1140 dumpioact(shf, t); in dumptree()
1142 shf_puts(" /TTHEN:\n", shf); in dumptree()
1143 dumptree(shf, t->left); in dumptree()
1146 shf_puts(" /TELIF:", shf); in dumptree()
1148 dumpioact(shf, t); in dumptree()
1152 shf_puts(" /TELSE:\n", shf); in dumptree()
1153 dumptree(shf, t->right); in dumptree()
1158 shf_puts(Tunexpected, shf); in dumptree()
1166 shf_fprintf(shf, "{T<%d>:" /*}*/, t->type); in dumptree()
1172 shf_fprintf(shf, /*{*/ " /%s}\n", name); in dumptree()