view runtime/blueprint.c @ 139:a68e6828d896

Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
author Mike Pavone <pavone@retrodev.com>
date Fri, 19 Nov 2010 04:04:14 -0500
parents 43cc42df26cc
children 9fab36cc706b
line wrap: on
line source

#include "blueprint.h"
#include "builtin.h"
#include "context.h"
#include <stddef.h>

typedef struct
{
	blueprint * bp;
} l_Build;

object * make_Blueprint(int32_t type_id)
{
	t_Blueprint * obj;
	object * ret = new_object(TYPE_BLUEPRINT);
	obj = (t_Blueprint *)ret;
	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;
	release_ref(left);
	release_ref(right);
	return l->bp == r->bp;
}