aboutsummaryrefslogtreecommitdiffstats
path: root/shell.c
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2018-02-05 11:28:24 -0500
committerClyne Sullivan <tullivan99@gmail.com>2018-02-05 11:28:24 -0500
commite67715637ac92cabf253c5405fb1cfd23342fa24 (patch)
tree0037a08ef77716744f672b2e3e51c8923ebd5f27 /shell.c
parent0c3901b3a87c4c37fdd61d115d87ee6c753b4576 (diff)
nested expressions, svalue
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/shell.c b/shell.c
index bd877a1..1d22269 100644
--- a/shell.c
+++ b/shell.c
@@ -4,15 +4,14 @@
#include <stdlib.h>
#include <string.h>
-void s_put(interpreter *it)
+int s_put(interpreter *it)
{
char *s = igetarg_string(it, 0);
- if (s == 0)
- s = "(null)";
printf("%s\n", s);
+ return 0;
}
-void s_type(interpreter *it)
+int s_type(interpreter *it)
{
variable *v = (variable *)it->stack[0];
switch (v->valtype) {
@@ -26,18 +25,20 @@ void s_type(interpreter *it)
puts("float");
break;
case FUNC:
- puts(v->value == 0 ? "undefined" : "func" );
+ puts("func");
break;
default:
puts("unknown");
break;
}
+ return 0;
}
-void quit(interpreter *it)
+int quit(interpreter *it)
{
(void)it;
exit(0);
+ return 0;
}
int main()