tinygi

diff src/object.c @ 0:16fdca2a1ef5

initial tinygi commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 19 Jul 2015 18:30:29 +0300
parents
children bc64090fe3d1
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/object.c	Sun Jul 19 18:30:29 2015 +0300
     1.3 @@ -0,0 +1,16 @@
     1.4 +#include <stdlib.h>
     1.5 +#include <string.h>
     1.6 +#include "object.h"
     1.7 +#include "logger.h"
     1.8 +
     1.9 +struct tgi_object *tgi_create_object(const char *name)
    1.10 +{
    1.11 +	struct tgi_object *o;
    1.12 +
    1.13 +	if(!(o = malloc(sizeof *o))) {
    1.14 +		tgi_log("failed to allocate memory\n");
    1.15 +		return 0;
    1.16 +	}
    1.17 +	memset(o, 0, sizeof *o);
    1.18 +	return o;
    1.19 +}