]> git.mdlowis.com Git - archive/carl.git/commitdiff
Removed exits functionality and changed formatting for rune type files
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 19 Sep 2015 00:29:42 +0000 (20:29 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 19 Sep 2015 00:29:42 +0000 (20:29 -0400)
source/exits.c [deleted file]
source/libc.h
source/main.c
tools/unicode.rb

diff --git a/source/exits.c b/source/exits.c
deleted file mode 100644 (file)
index f4d461f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "libc.h"
-
-char* errstr = nil;
-
-static int exitcode(void)
-{
-    return errstr ? 1 : errno;
-}
-
-void exits(char* estr)
-{
-    errstr = estr;
-    exit(exitcode());
-}
-
index cac2cb2ac7ed521c0abb09392a6adb7353193e68..adf55d4bd6b960ce8833ad5cea3eb16dd0295e00 100644 (file)
@@ -446,18 +446,12 @@ int iovprint(iobuf*, char*, va_list);
     #endif
 #endif
 
-/*
- * New Features
- */
-extern char* errstr;
-void exits(char* str);
-
 /*
  * Make sure we use the built-in main which calls user_main
  */
 #ifndef NO_MAIN_WRAPPER
     #define main user_main
 #endif
-void user_main(int, char**);
+int user_main(int, char**);
 
 #endif /* LIBC_H */
index 8b70bcc4219d2756a0de577d2292e464a437e94c..bf53ea5ea9f017b83f0d46afaacdbcf8e7482e64 100644 (file)
@@ -1,10 +1,7 @@
 #define NO_MAIN_WRAPPER
 #include "libc.h"
 
-int main(int argc, char** argv)
-{
-    user_main(argc, argv);
-    exits(errstr);
-    return -1;
+int main(int argc, char** argv) {
+    return user_main(argc, argv);
 }
 
index fd0863633177268e23fd28d4ed8cb20c1f3f4c6e..a632b6160861fa4e02bc22d78548f727775080f0 100755 (executable)
@@ -93,7 +93,7 @@ def get_ranges(table)
 end
 
 def generate_typecheck_func(type, count)
-    "extern int runeinrange(const void* a, const void* b);\n" +
+    "extern int runeinrange(const void* a, const void* b);\n\n" +
     "bool is#{type.to_s.gsub(/s$/,'')}rune(Rune ch) {\n" +
     "    return (NULL != bsearch(&ch, #{type}, #{count}, 2 * sizeof(Rune), &runeinrange));\n" +
     "}\n"