• 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
73 fptreef(shf, indent, "%S", t->vars[0]); in ptree()
80 fptreef(shf, indent, "%S ", *w++); in ptree()
82 shf_puts("#no-vars# ", shf); in ptree()
86 fptreef(shf, indent, "%S ", *w++); in ptree()
88 shf_puts("#no-args# ", shf); in ptree()
94 fptreef(shf, indent + 2, "( %T) ", t->left); in ptree()
97 fptreef(shf, indent, "%T| ", t->left); in ptree()
101 fptreef(shf, indent, "%T%;", t->left); in ptree()
106 fptreef(shf, indent, "%T%s %T", in ptree()
110 shf_puts("! ", shf); in ptree()
116 shf_puts("[[", shf); in ptree()
118 fptreef(shf, indent, " %S", *w++); in ptree()
119 shf_puts(" ]] ", shf); in ptree()
123 fptreef(shf, indent, "%s %s ", in ptree()
126 shf_puts("in ", shf); in ptree()
129 fptreef(shf, indent, "%S ", *w++); in ptree()
130 fptreef(shf, indent, "%;"); in ptree()
132 fptreef(shf, indent + INDENT, "do%N%T", t->left); in ptree()
133 fptreef(shf, indent, "%;done "); in ptree()
136 fptreef(shf, indent, "case %S in", t->str); in ptree()
138 fptreef(shf, indent, "%N("); in ptree()
141 fptreef(shf, indent, "%S%c", *w, in ptree()
145 fptreef(shf, indent + INDENT, "%N%T%N;%c", t1->left, in ptree()
148 fptreef(shf, indent, "%Nesac "); in ptree()
162 fptreef(shf, indent, "%;"); in ptree()
165 fptreef(shf, indent + 5 - i, Telif_pT + i, t1->left); in ptree()
168 fptreef(shf, indent, "%;"); in ptree()
169 fptreef(shf, indent + INDENT, "%s%N%T", in ptree()
174 fptreef(shf, indent, "%;"); in ptree()
175 fptreef(shf, indent + INDENT, "%s%N%T", in ptree()
178 fptreef(shf, indent, "%;fi "); in ptree()
183 fptreef(shf, indent + 6, "%s %T", in ptree()
186 fptreef(shf, indent, "%;"); in ptree()
187 fptreef(shf, indent + INDENT, "do%N%T", t->right); in ptree()
188 fptreef(shf, indent, "%;done "); in ptree()
191 fptreef(shf, indent + INDENT, "{%N%T", t->left); in ptree()
192 fptreef(shf, indent, "%;} "); in ptree()
195 fptreef(shf, indent, "%T|& ", t->left); in ptree()
199 fptreef(shf, indent, "%T& ", t->left); in ptree()
203 fpFUNCTf(shf, indent, tobool(t->u.ksh_func), t->str, t->left); in ptree()
206 fptreef(shf, indent, "%s %T", "time", t->left); in ptree()
209 shf_puts("<botch>", shf); in ptree()
217 pioact(shf, *ioact++); in ptree()
226 shf_putc('\n', shf); in ptree()
227 shf_puts(iop->heredoc, shf); in ptree()
228 fptreef(shf, indent, "%s", in ptree()
239 shf_putc('\n', shf); in ptree()
246 pioact(struct shf *shf, struct ioword *iop) in pioact() argument
257 shf_fprintf(shf, "%d", (int)iop->unit); in pioact()
261 shf_putc('<', shf); in pioact()
264 shf_puts("<<", shf); in pioact()
266 shf_putc('-', shf); in pioact()
268 shf_putc('<', shf); in pioact()
271 shf_puts(">>", shf); in pioact()
274 shf_putc('>', shf); in pioact()
276 shf_putc('|', shf); in pioact()
279 shf_puts("<>", shf); in pioact()
282 shf_puts(flag & IORDUP ? "<&" : ">&", shf); in pioact()
288 wdvarput(shf, iop->delim, 0, WDS_TPUTS); in pioact()
291 print_value_quoted(shf, iop->ioname); in pioact()
293 wdvarput(shf, iop->ioname, 0, WDS_TPUTS); in pioact()
295 shf_putc(' ', shf); in pioact()
301 wdvarput(struct shf *shf, const char *wp, int quotelevel, int opmode) in wdvarput() argument
327 shf_putc(c, shf); in wdvarput()
341 shf_putc('\\', shf); in wdvarput()
342 shf_putc(c, shf); in wdvarput()
346 shf_puts("$(", shf); in wdvarput()
350 shf_putc(c, shf); in wdvarput()
351 shf_puts(cs, shf); in wdvarput()
359 shf_putc('$', shf); in wdvarput()
360 shf_putc('{', shf); in wdvarput()
361 shf_putc(c, shf); in wdvarput()
365 shf_puts("$((", shf); in wdvarput()
371 shf_putc('"', shf); in wdvarput()
378 shf_putc('"', shf); in wdvarput()
382 shf_putc('$', shf); in wdvarput()
384 shf_putc('{', shf); in wdvarput()
386 shf_putc(c, shf); in wdvarput()
387 wp = wdvarput(shf, wp, 0, opmode); in wdvarput()
392 shf_putc('}', shf); in wdvarput()
396 shf_putchar(*wp++, shf); in wdvarput()
397 shf_putc('(', shf); in wdvarput()
404 shf_putc(c, shf); in wdvarput()
415 fptreef(struct shf *shf, int indent, const char *fmt, ...) in fptreef() argument
420 vfptreef(shf, indent, fmt, va); in fptreef()
429 struct shf shf; in snptreef() local
431 shf_sopen(s, n, SHF_WR | (s ? 0 : SHF_DYNAMIC), &shf); in snptreef()
434 vfptreef(&shf, 0, fmt, va); in snptreef()
438 return (shf_sclose(&shf)); in snptreef()
442 vfptreef(struct shf *shf, int indent, const char *fmt, va_list va) in vfptreef() argument
451 shf_putchar(va_arg(va, int), shf); in vfptreef()
455 shf_puts(va_arg(va, char *), shf); in vfptreef()
459 wdvarput(shf, va_arg(va, char *), 0, WDS_TPUTS); in vfptreef()
463 shf_fprintf(shf, "%d", va_arg(va, int)); in vfptreef()
467 shf_fprintf(shf, "%u", va_arg(va, unsigned int)); in vfptreef()
471 ptree(va_arg(va, struct op *), indent, shf); in vfptreef()
477 if (shf->flags & SHF_STRING) { in vfptreef()
479 shf_putc(';', shf); in vfptreef()
480 shf_putc(' ', shf); in vfptreef()
484 shf_putc('\n', shf); in vfptreef()
487 shf_putc('\t', shf); in vfptreef()
491 shf_putc(' ', shf); in vfptreef()
496 pioact(shf, va_arg(va, struct ioword *)); in vfptreef()
499 shf_putc(c, shf); in vfptreef()
503 shf_putc(c, shf); in vfptreef()
646 struct shf shf; in wdstrip() local
648 shf_sopen(NULL, 32, SHF_WR | SHF_DYNAMIC, &shf); in wdstrip()
649 wdvarput(&shf, wp, 0, opmode); in wdstrip()
651 return (shf_sclose(&shf)); in wdstrip()
739 fpFUNCTf(struct shf *shf, int i, bool isksh, const char *k, struct op *v) in fpFUNCTf() argument
742 fptreef(shf, i, "%s %s %T", Tfunction, k, v); in fpFUNCTf()
744 fptreef(shf, i, "%s %s() %T", Tfunction, k, v); in fpFUNCTf()
746 fptreef(shf, i, "%s() %T", k, v); in fpFUNCTf()
797 dumpchar(struct shf *shf, int c) in dumpchar() argument
801 shf_putc((c & 0x80) ? '$' : '^', shf); in dumpchar()
804 shf_putc(c, shf); in dumpchar()
809 dumpwdvar_i(struct shf *shf, const char *wp, int quotelevel) in dumpwdvar_i() argument
816 shf_puts("EOS", shf); in dumpwdvar_i()
820 shf_puts("]ADELIM(})", shf); in dumpwdvar_i()
823 shf_puts("ADELIM=", shf); in dumpwdvar_i()
826 shf_puts("CHAR=", shf); in dumpwdvar_i()
827 dumpchar(shf, *wp++); in dumpwdvar_i()
830 shf_puts("QCHAR<", shf); in dumpwdvar_i()
834 shf_putc('\\', shf); in dumpwdvar_i()
835 dumpchar(shf, c); in dumpwdvar_i()
838 shf_puts("COMSUB<", shf); in dumpwdvar_i()
841 dumpchar(shf, c); in dumpwdvar_i()
843 shf_putc('>', shf); in dumpwdvar_i()
846 shf_puts("FUNSUB<", shf); in dumpwdvar_i()
849 shf_puts("VALSUB<", shf); in dumpwdvar_i()
852 shf_puts("EXPRSUB<", shf); in dumpwdvar_i()
855 shf_fprintf(shf, "OQUOTE{%d", ++quotelevel); in dumpwdvar_i()
858 shf_fprintf(shf, "%d}CQUOTE", quotelevel); in dumpwdvar_i()
862 shf_puts("(err)", shf); in dumpwdvar_i()
865 shf_puts("OSUBST(", shf); in dumpwdvar_i()
866 dumpchar(shf, *wp++); in dumpwdvar_i()
867 shf_puts(")[", shf); in dumpwdvar_i()
869 dumpchar(shf, c); in dumpwdvar_i()
870 shf_putc('|', shf); in dumpwdvar_i()
871 wp = dumpwdvar_i(shf, wp, 0); in dumpwdvar_i()
874 shf_puts("]CSUBST(", shf); in dumpwdvar_i()
875 dumpchar(shf, *wp++); in dumpwdvar_i()
876 shf_putc(')', shf); in dumpwdvar_i()
879 shf_puts("OPAT=", shf); in dumpwdvar_i()
880 dumpchar(shf, *wp++); in dumpwdvar_i()
883 shf_puts("SPAT", shf); in dumpwdvar_i()
886 shf_puts("CPAT", shf); in dumpwdvar_i()
889 shf_fprintf(shf, "INVAL<%u>", (uint8_t)wp[-1]); in dumpwdvar_i()
892 shf_putc(' ', shf); in dumpwdvar_i()
896 dumpwdvar(struct shf *shf, const char *wp) in dumpwdvar() argument
898 dumpwdvar_i(shf, wp, 0); in dumpwdvar()
902 dumpioact(struct shf *shf, struct op *t) in dumpioact() argument
909 shf_puts("{IOACT", shf); in dumpioact()
912 #define DT(x) case x: shf_puts(#x, shf); break; in dumpioact()
913 #define DB(x) if (iop->ioflag & x) shf_puts("|" #x, shf); in dumpioact()
915 shf_putc(';', shf); in dumpioact()
924 shf_fprintf(shf, "unk%d", type); in dumpioact()
934 shf_fprintf(shf, ",unit=%d", (int)iop->unit); in dumpioact()
936 shf_puts(",delim<", shf); in dumpioact()
937 dumpwdvar(shf, iop->delim); in dumpioact()
938 shf_putc('>', shf); in dumpioact()
942 shf_puts(",name=", shf); in dumpioact()
943 print_value_quoted(shf, iop->ioname); in dumpioact()
945 shf_puts(",name<", shf); in dumpioact()
946 dumpwdvar(shf, iop->ioname); in dumpioact()
947 shf_putc('>', shf); in dumpioact()
951 shf_puts(",heredoc=", shf); in dumpioact()
952 print_value_quoted(shf, iop->heredoc); in dumpioact()
957 shf_putc('}', shf); in dumpioact()
961 dumptree(struct shf *shf, struct op *t) in dumptree() argument
969 shf_putc('\t', shf); in dumptree()
971 shf_puts("{tree:" /*}*/, shf); in dumptree()
976 dumpioact(shf, t); in dumptree()
978 #define OPEN(x) case x: name = #x; shf_puts(" {" #x ":", shf); /*}*/ in dumptree()
985 shf_putc('\n', shf); in dumptree()
987 shf_putc('\t', shf); in dumptree()
988 shf_fprintf(shf, " var%d<", i++); in dumptree()
989 dumpwdvar(shf, *w++); in dumptree()
990 shf_putc('>', shf); in dumptree()
993 shf_puts(" #no-vars#", shf); in dumptree()
998 shf_putc('\n', shf); in dumptree()
1000 shf_putc('\t', shf); in dumptree()
1001 shf_fprintf(shf, " arg%d<", i++); in dumptree()
1002 dumpwdvar(shf, *w++); in dumptree()
1003 shf_putc('>', shf); in dumptree()
1006 shf_puts(" #no-args#", shf); in dumptree()
1012 shf_putc('\n', shf); in dumptree()
1013 dumptree(shf, t); in dumptree()
1019 shf_putc('\n', shf); in dumptree()
1020 dumptree(shf, t->left); in dumptree()
1022 shf_fprintf(shf, "/%s:", name); in dumptree()
1038 shf_putc('\n', shf); in dumptree()
1040 shf_putc('\t', shf); in dumptree()
1041 shf_fprintf(shf, " arg%d<", i++); in dumptree()
1042 dumpwdvar(shf, *w++); in dumptree()
1043 shf_putc('>', shf); in dumptree()
1048 shf_fprintf(shf, " str<%s>", t->str); in dumptree()
1053 shf_putc('\n', shf); in dumptree()
1055 shf_putc('\t', shf); in dumptree()
1056 shf_fprintf(shf, " var%d<", i++); in dumptree()
1057 dumpwdvar(shf, *w++); in dumptree()
1058 shf_putc('>', shf); in dumptree()
1065 shf_fprintf(shf, " str<%s>", t->str); in dumptree()
1068 shf_putc('\n', shf); in dumptree()
1070 shf_putc('\t', shf); in dumptree()
1071 shf_fprintf(shf, " sub%d[(", i); in dumptree()
1074 dumpwdvar(shf, *w); in dumptree()
1076 shf_putc('|', shf); in dumptree()
1079 shf_putc(')', shf); in dumptree()
1080 dumpioact(shf, t); in dumptree()
1081 shf_putc('\n', shf); in dumptree()
1082 dumptree(shf, t1->left); in dumptree()
1083 shf_fprintf(shf, " ;%c/%d]", t1->u.charflag, i++); in dumptree()
1097 shf_fprintf(shf, " str<%s> ksh<%s>", t->str, in dumptree()
1104 shf_putc('\n', shf); in dumptree()
1105 dumptree(shf, t->left); in dumptree()
1107 dumpioact(shf, t); in dumptree()
1109 shf_puts(" /TTHEN:\n", shf); in dumptree()
1110 dumptree(shf, t->left); in dumptree()
1113 shf_puts(" /TELIF:", shf); in dumptree()
1115 dumpioact(shf, t); in dumptree()
1119 shf_puts(" /TELSE:\n", shf); in dumptree()
1120 dumptree(shf, t->right); in dumptree()
1125 shf_puts("unexpected", shf); in dumptree()
1133 shf_fprintf(shf, "{T<%d>:" /*}*/, t->type); in dumptree()
1139 shf_fprintf(shf, /*{*/ " /%s}\n", name); in dumptree()