diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-11-16 12:08:59 -0800 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-11-16 12:08:59 -0800 |
commit | 29138fff8643194ec49cb79304d2a878d46c378b (patch) | |
tree | 04f46762380d84994ec821cec13f1ff8288d46fc /src/cmd/rc/rc.h | |
parent | e4f9b993e97b6e6e790810b6d261dc5bf61b0513 (diff) |
Feat: added heredocs
Heredocs are simply strings written to tmp files.
There was minimal bug testing here.
Also, various bug fixes are included
Diffstat (limited to 'src/cmd/rc/rc.h')
-rw-r--r-- | src/cmd/rc/rc.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h index 0c006e3..720c6f2 100644 --- a/src/cmd/rc/rc.h +++ b/src/cmd/rc/rc.h @@ -32,6 +32,7 @@ enum Rhere, Rdupfd, Ropen, + Rdup, Rclose, Rrdwr }; @@ -45,7 +46,7 @@ struct Tree char *str; // Tword }; struct { - ushort type; // Tpipe, Tredir, Tdup + ushort type; // Tpipe, Tredir, Tdup, There int fd[2]; } redir; }; @@ -198,10 +199,18 @@ int put(Io **, char); void flush(Io *io); void print(Io *, char *, ...); +void printstr(Io *, char *); +void printchar(Io *, int); /* lex.c */ -int iswordchar(int c); -int yylex(void); +int yylex(void); +void yyerror(const char *msg); + +void readhere(void); +Tree *heredoc(Tree *); + +int iswordchar(int c); +int isidentchar(int c); /* tree.c */ Tree *maketree(void); @@ -266,6 +275,7 @@ char **mkenv(void); int compile(Tree *); Code *copycode(Code *c); void freecode(Code *c); +void emitdelhere(char *); /* glob.c */ #define GLOB ((char)(0x01)) |