ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/free_os.c
Revision: 3.2
Committed: Tue Feb 25 02:47:21 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 3.1: +1 -56 lines
Log Message:
Replaced inline copyright notice with #include "copyright.h"

File Contents

# User Rev Content
1 greg 3.1 #ifndef lint
2     static const char RCSid[] = "$Id$";
3     #endif
4     /*
5     * Free memory associated with object(s)
6     *
7     * External symbols declared in object.h
8     */
9    
10 greg 3.2 #include "copyright.h"
11 greg 3.1
12     #include "standard.h"
13     #include "octree.h"
14     #include "object.h"
15     #include "otypes.h"
16     #include "face.h"
17     #include "cone.h"
18     #include "instance.h"
19    
20    
21     int
22     free_os(op) /* free unneeded memory for object */
23     register OBJREC *op;
24     {
25     if (op->os == NULL)
26     return(0);
27     switch (op->otype) {
28     case OBJ_FACE: /* polygon */
29     freeface(op);
30     return(1);
31     case OBJ_CONE: /* cone */
32     case OBJ_RING: /* disk */
33     case OBJ_CYLINDER: /* cylinder */
34     case OBJ_CUP: /* inverted cone */
35     case OBJ_TUBE: /* inverted cylinder */
36     freecone(op);
37     return(1);
38     case OBJ_INSTANCE: /* octree instance */
39     freeinstance(op);
40     return(1);
41     }
42     /* don't really know */
43     free((void *)op->os);
44     op->os = NULL;
45     return(1);
46     }