comparison files.c @ 7:b8167949474a

make places work better
author David A. Holland
date Sun, 19 Dec 2010 19:08:24 -0500
parents 0601b6e8e53d
children 97243badae69
comparison
equal deleted inserted replaced
6:0601b6e8e53d 7:b8167949474a
182 assert(scratchplace_inuse); 182 assert(scratchplace_inuse);
183 assert(p == &scratchplace); 183 assert(p == &scratchplace);
184 scratchplace_inuse = false; 184 scratchplace_inuse = false;
185 } 185 }
186 186
187 struct place *
188 place_create(void)
189 {
190 struct place *p;
191
192 p = domalloc(sizeof(*p));
193 place_setnowhere(p);
194 return p;
195 }
196
197 struct place *
198 place_clone(const struct place *op)
199 {
200 struct place *p;
201
202 p = domalloc(sizeof(*p));
203 *p = *op;
204 return p;
205 }
206
207 void
208 place_destroy(struct place *p)
209 {
210 free(p);
211 }
212
187 void 213 void
188 place_setnowhere(struct place *p) 214 place_setnowhere(struct place *p)
189 { 215 {
190 p->file = NULL; 216 p->file = NULL;
191 p->line = NOWHERE_LINE; 217 p->line = NOWHERE_LINE;