diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-06-18 19:45:40 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-06-18 19:45:40 -0700 |
commit | 425ef692da7e74112f88f0b368f3286dba84f846 (patch) | |
tree | d45729e90010e8d8c539031c3b72165f6884575d /sys/libn | |
parent | 0522b4bf4e125b7ceb67f7177db692aed3a0ebf9 (diff) |
feat: working parser for rc shell language
Diffstat (limited to 'sys/libn')
-rw-r--r-- | sys/libn/error.c | 10 | ||||
-rw-r--r-- | sys/libn/memory.c | 5 | ||||
-rw-r--r-- | sys/libn/rules.mk | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/sys/libn/error.c b/sys/libn/error.c index 95a534a..a9d684c 100644 --- a/sys/libn/error.c +++ b/sys/libn/error.c @@ -1,6 +1,16 @@ #include <u.h> #include <libn.h> +void +exits(char *s) +{ + if (s == nil || *s == 0) + exit(0); + + fputs(s, stderr); + exit(1); +} + void errorf(byte* fmt, ...) { diff --git a/sys/libn/memory.c b/sys/libn/memory.c index 31f910e..999819b 100644 --- a/sys/libn/memory.c +++ b/sys/libn/memory.c @@ -194,8 +194,3 @@ memset64(void *dst, uint64 val, uintptr size) ((byte*)dst)[i] = ((byte*)&val)[i&7]; } } - -// ------------------------------------------------------------------------- -// First argument - -char *argv0; diff --git a/sys/libn/rules.mk b/sys/libn/rules.mk index 61a56fe..abcd60d 100644 --- a/sys/libn/rules.mk +++ b/sys/libn/rules.mk @@ -6,11 +6,13 @@ include share/push.mk # Local sources SRCS_$(d) := \ + $(d)/arg.c \ $(d)/bufio.c \ $(d)/coro_unix_x64.s \ $(d)/coro.c \ $(d)/error.c \ $(d)/flate.c \ + $(d)/fs.c \ $(d)/gz.c \ $(d)/io.c \ $(d)/os.c \ |