Mercurial > hg > Members > koba > t_dandy
annotate object.c @ 14:c7e7971a76d0
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 16 Dec 2010 15:29:43 +0900 |
parents | 435ac1cdb64e |
children |
rev | line source |
---|---|
0 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 #include <libxml/parser.h> | |
5 #include "object.h" | |
6 | |
7 void init_object(OBJECT *obj) | |
8 { | |
9 obj->name = NULL; | |
10 obj->surfaces = NULL; | |
11 } | |
12 | |
13 void free_object(OBJECT *obj) | |
14 { | |
15 SURFACE *cur,*next; | |
16 | |
17 if (obj == NULL) | |
18 { | |
19 printf("obj is NULL\n"); | |
20 return; | |
21 } | |
22 for(cur=obj->surfaces;cur;cur=next) | |
23 { | |
24 next = cur->next; | |
25 free(cur); | |
26 } | |
27 free(obj->free_me); | |
28 } |