summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-14 15:01:55 +0800
committerDeterminant <[email protected]>2015-05-14 15:01:55 +0800
commitf48dc493b5b77fd4e4472dd6c78b7542a4884129 (patch)
tree0b7a0f95df28fc100fc1fd252ce1d0215d19150d /common.c
parent46ccec6d5ad057476e945afa34981f7e8d732547 (diff)
add basic matrix implementation
Diffstat (limited to 'common.c')
-rw-r--r--common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/common.c b/common.c
new file mode 100644
index 0000000..f5521fd
--- /dev/null
+++ b/common.c
@@ -0,0 +1,19 @@
+#ifndef NERV_COMMON_H
+#define NERV_COMMON_H
+#include "common.h"
+#include <stdarg.h>
+int nerv_error(lua_State *L, const char *err_mesg_fmt, ...) {
+ va_list ap;
+ va_start(ap, err_mesg_fmt);
+ lua_pushstring(L, "Nerv internal error: ");
+ lua_pushvfstring(L, err_mesg_fmt, ap);
+ lua_concat(L, 2);
+ lua_error(L);
+ va_end(ap);
+ return 0;
+}
+
+int nerv_error_method_not_implemented(lua_State *L) {
+ return nerv_error(L, "method not implemented");
+}
+#endif