Mercurial > ~dholland > hg > tradcpp > index.cgi
diff place.c @ 11:b9d50e786322
simplify places
author | David A. Holland |
---|---|
date | Sun, 19 Dec 2010 19:30:24 -0500 |
parents | 800f3a560a3b |
children | 6c15ca895585 |
line wrap: on
line diff
--- a/place.c Sun Dec 19 19:27:14 2010 -0500 +++ b/place.c Sun Dec 19 19:30:24 2010 -0500 @@ -19,13 +19,9 @@ DECLARRAY(seenfile); DEFARRAY(seenfile, ); +static struct seenfilearray seenfiles; static bool overall_failure; -static struct place scratchplace; -static bool scratchplace_inuse; - -static struct seenfilearray seenfiles; - //////////////////////////////////////////////////////////// // seenfiles @@ -86,48 +82,6 @@ return p->file == NULL && p->line == COMMANDLINE_LINE; } -struct place * -place_gettemporary(void) -{ - assert(!scratchplace_inuse); - scratchplace_inuse = true; - return &scratchplace; -} - -void -place_puttemporary(struct place *p) -{ - assert(scratchplace_inuse); - assert(p == &scratchplace); - scratchplace_inuse = false; -} - -struct place * -place_create(void) -{ - struct place *p; - - p = domalloc(sizeof(*p)); - place_setnowhere(p); - return p; -} - -struct place * -place_clone(const struct place *op) -{ - struct place *p; - - p = domalloc(sizeof(*p)); - *p = *op; - return p; -} - -void -place_destroy(struct place *p) -{ - free(p); -} - void place_setnowhere(struct place *p) {