ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/sm_list.c
(Generate patch)

Comparing ray/src/hd/sm_list.c (file contents):
Revision 3.4 by gwlarson, Mon Dec 28 18:07:35 1998 UTC vs.
Revision 3.8 by greg, Sat Feb 22 02:07:25 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  sm_list.c
6   *   Routines for handling linked generic linked lists, stack, and
# Line 20 | Line 17 | static LIST *free_lists = NULL;
17   extern int Malloc_cnt;  
18   #endif
19   LIST
20 + /* NOTE: Memory is not initialized */
21   *new_list()
22   {
23      LIST *l;
# Line 36 | Line 34 | LIST
34        if( !(l = (LIST *)malloc(sizeof(LIST))))
35            error(SYSTEM,"new_list():Unable to allocate memory");
36      }
39    /* clear the memory */
40    bzero(l, sizeof(LIST));
41
37      return(l);
38   }
39  
# Line 74 | Line 69 | LIST **end;
69  
70      list = new_list();
71      SET_LIST_DATA(list,d);
72 <
72 >    SET_LIST_NEXT(list,NULL);
73      if(!l)
74      {
75        if(end)
# Line 124 | Line 119 | int d;
119      return(l);
120   }
121  
127 /* Pushes data element d at the top of the list- returns pointer
128   to new top of list
129 */
130 LIST
131 *push_data(l,d)
132 LIST *l;
133 int d;
134 {
135    LIST * list;
136    
137    list = new_list();
138    SET_LIST_DATA(list,d);
139    SET_LIST_NEXT(list,l);
140    return(list);
141 }
122  
123 +
124   /* frees the list */
125   LIST
126   *free_list(l)
# Line 153 | Line 134 | LIST * l;
134      return(NULL);
135   }
136  
137 + /* Pushes data element d at the top of the list- returns pointer
138 +   to new top of list
139 + */
140 + LIST
141 + *push_data(l,d)
142 + LIST *l;
143 + int d;
144 + {
145 +  LIST *list;
146 +
147 +  list = new_list();
148 +  SET_LIST_DATA(list,d);
149 +  SET_LIST_NEXT(list,l);
150 +  return(list);
151 + }
152   /* Returns data element d at the top of the list- returns pointer
153     to new top of list
154   */
# Line 209 | Line 205 | LIST **list;
205      }
206      return(FALSE);
207   }
208 +
209 +
210 +
211 +
212  
213  
214  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines