Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

storeRefNodeList.c File Reference

#include "lclintMacros.nf"
#include "llbasic.h"

Go to the source code of this file.

Functions

storeRefNodeList storeRefNodeList_new ()
storeRefNodeList storeRefNodeList_add (storeRefNodeList s, storeRefNode el)
storeRefNodeList storeRefNodeList_copy (storeRefNodeList s)
cstring storeRefNodeList_unparse (storeRefNodeList s)
void storeRefNodeList_free (storeRefNodeList s)


Function Documentation

storeRefNodeList storeRefNodeList_add ( storeRefNodeList s,
storeRefNode el )
 

Definition at line 69 of file storeRefNodeList.c.

Referenced by storeRefNodeList_copy().

00070 {
00071   if (s->nspace <= 0)
00072     storeRefNodeList_grow (s);
00073 
00074   s->nspace--;
00075   s->elements[s->nelements] = el;
00076   s->nelements++;
00077 
00078   return s;
00079 }

storeRefNodeList storeRefNodeList_copy ( storeRefNodeList s )
 

Definition at line 82 of file storeRefNodeList.c.

00083 {
00084   storeRefNodeList r = storeRefNodeList_new ();
00085 
00086   storeRefNodeList_elements (s, x)
00087     {
00088       r = storeRefNodeList_add (r, storeRefNode_copy (x));
00089     } end_storeRefNodeList_elements;
00090 
00091   return r;
00092 }

void storeRefNodeList_free ( storeRefNodeList s )
 

Definition at line 132 of file storeRefNodeList.c.

00133 {
00134   int i;
00135   for (i = 0; i < s->nelements; i++)
00136     {
00137       storeRefNode_free (s->elements[i]);
00138     }
00139 
00140   sfree (s->elements);
00141   sfree (s);
00142 }

storeRefNodeList storeRefNodeList_new ( )
 

Definition at line 36 of file storeRefNodeList.c.

Referenced by storeRefNodeList_copy().

00037 {
00038   storeRefNodeList s = (storeRefNodeList) dmalloc (sizeof (*s));
00039 
00040   s->nelements = 0;
00041   s->nspace = storeRefNodeListBASESIZE;
00042   s->elements = (storeRefNode *) 
00043     dmalloc (sizeof (*s->elements) * storeRefNodeListBASESIZE);
00044 
00045   return (s);
00046 }

cstring storeRefNodeList_unparse ( storeRefNodeList s )
 

Definition at line 95 of file storeRefNodeList.c.

00096 {
00097   bool first = TRUE;
00098   cstring st = cstring_undefined;
00099 
00100   storeRefNodeList_elements (s, current)
00101   {
00102     if (first)
00103       {
00104         first = FALSE;
00105       }
00106     else
00107       {
00108         st = message ("%q, ", st);
00109       }
00110 
00111     switch (current->kind)
00112       {
00113       case SRN_OBJ:
00114         st = message ("%qobj", st);
00115         /*@switchbreak@*/ break;
00116       case SRN_TERM:
00117         st = message ("%q%q", st, termNode_unparse (current->content.term));
00118         /*@switchbreak@*/ break;
00119       case SRN_TYPE:
00120         st = message ("%q%q", st, lclTypeSpecNode_unparse (current->content.type));
00121         /*@switchbreak@*/ break;
00122       case SRN_SPECIAL:
00123         st = message ("%q%q", st, sRef_unparse (current->content.ref));
00124         /*@switchbreak@*/ break;
00125       }
00126   } end_storeRefNodeList_elements;
00127 
00128   return st;
00129 }


Generated at Fri Nov 3 18:58:13 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000