Mercurial > repos > rhope
diff runtime/blueprint.c @ 63:04baa003de5a
Merged latest changes with better C branch
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 05 May 2010 22:12:23 -0400 |
parents | 3e20ed8959c4 |
children | d4b44ae2e34a |
line wrap: on
line diff
--- a/runtime/blueprint.c Sat Oct 10 16:43:37 2009 -0400 +++ b/runtime/blueprint.c Wed May 05 22:12:23 2010 -0400 @@ -1,6 +1,7 @@ #include "blueprint.h" #include "builtin.h" -#include "context.h" +#include "context.h" +#include <stddef.h> typedef struct { @@ -18,6 +19,18 @@ release_ref(cdata->params[0]); Ret(0, new_object_bp(locals->bp)) +EndFunc + +Func(BlueprintSP_Of, + NumParams 1, + CallSpace 1, + l_Build) + + locals->bp = get_blueprint(cdata->params[0]); + release_ref(cdata->params[0]); + + Ret(0, new_object(TYPE_BLUEPRINT)) + ((t_Blueprint *)cdata->params[0])->bp = locals->bp; EndFunc object * make_Blueprint(int32_t type_id) @@ -25,6 +38,15 @@ t_Blueprint * obj; object * ret = new_object(TYPE_BLUEPRINT); obj = (t_Blueprint *)ret; - obj->bp = get_blueprint_byid(type_id); + obj->bp = type_id ? get_blueprint_byid(type_id) : NULL; return ret; -} +} + +int32_t _internal_blueprint_eq(object * left, object * right) +{ + t_Blueprint * l = (t_Blueprint *)left; + t_Blueprint * r = (t_Blueprint *)right; + return l->bp == r->bp; +} + +