1 /* @(#)db3.c	1.2	04/18/83
2  *
3  *
4  * Copyright -C- 1982 Barry S. Roitblat
5  *
6  *       This file contains additional routines to implement the database
7  * manipulations necessary for the gremlin picture editor.
8  */
9 
10 #include "gremlin.h"
11 #include "grem2.h"
12 
13 /* the following variable is a pointer for the current set and is
14  * available to the outside world.
15  */
16 
17 ELT *cset;
18 
19 DBAddSet(element)
20 ELT *element;
21 /*
22  *      This routine adds the element to the current set database.
23  */
24 
25 {
26 	ELT *elist;
27 
28 	elist = cset;
29 	while ( !DBNullelt(elist) )             /* makes sure element not */
30 	{                                       /* already in list        */
31 		if (elist == element) return;
32 		elist = DBNextofSet(elist);
33 	};
34 	element->setnext = cset;
35 	cset = element;
36 }  /* end AddSet */
37 
38 DBClearSet()
39 /*
40  *      This routine clears the current set by setting the pointer
41  * to a null element.
42  */
43 
44 {
45 	while ( !DBNullelt(cset) )
46 		cset = DBNextofSet(cset);
47 }  /* end ClearSet */
48