aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/prompt.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-15 16:18:02 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-15 16:18:02 -0700
commitbf03074e346b004659196b6c17eee04dbffd3ac2 (patch)
tree7200db30f1ef7e3661091552932eb304bd4ce9c6 /sys/cmd/rc/prompt.c
parent566d54fe549286895fdef8aa9f385686405dd290 (diff)
feat(rc): working prototype of input->compile->print loop
Diffstat (limited to 'sys/cmd/rc/prompt.c')
-rw-r--r--sys/cmd/rc/prompt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/cmd/rc/prompt.c b/sys/cmd/rc/prompt.c
new file mode 100644
index 0000000..b4b1d96
--- /dev/null
+++ b/sys/cmd/rc/prompt.c
@@ -0,0 +1,17 @@
+#include "rc.h"
+
+int
+prompt(ushort *flag)
+{
+ int f = *flag;
+ if(f){
+ if(!readline("> ")){
+ shell->flag.eof = 1;
+ return 0;
+ }
+
+ shell->line++;
+ *flag = 0;
+ }
+ return 1;
+}