diff runtime/builtin.c @ 7:d61550e2c001

Added current work on new runtime
author Mike Pavone <pavone@retrodev.com>
date Wed, 13 May 2009 00:47:40 -0400
parents
children 31f8182f3433
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/builtin.c	Wed May 13 00:47:40 2009 -0400
@@ -0,0 +1,25 @@
+#include "builtin.h"
+#include "object.h"
+#include "integer.h"
+#include <stddef.h>
+
+void register_builtin_type(uint32_t type)
+{
+	blueprint * bp;
+	switch(type)
+	{
+	case TYPE_INT32:
+		bp = register_type_byid(TYPE_INT32, sizeof(int32_t), NULL, NULL, NULL);
+		add_method(bp, METHOD_ADD, MethodName(_PL_,Int32));
+		add_method(bp, METHOD_SUB, MethodName(_MN_,Int32));
+		break;
+	}
+}
+
+void register_builtin_types()
+{
+	uint32_t i;
+	for(i = 0; i < TYPE_FIRST_USER; ++i)
+		register_builtin_type(i);
+}
+