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

paramNodeList.c File Reference

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

Go to the source code of this file.

Functions

paramNodeList paramNodeList_new ()
paramNodeList paramNodeList_single ( paramNode p)
paramNodeList paramNodeList_add (paramNodeList s, paramNode el)
paramNodeList paramNodeList_copy (paramNodeList s)
cstring paramNodeList_unparse (paramNodeList s)
cstring paramNodeList_unparseComments (paramNodeList s)
void paramNodeList_free ( paramNodeList s)


Function Documentation

paramNodeList paramNodeList_add ( paramNodeList s,
paramNode el )
 

Definition at line 82 of file paramNodeList.c.

Referenced by paramNodeList_copy().

00083 {
00084   llassert (paramNodeList_isDefined (s));
00085 
00086   if (s->nspace <= 0)
00087     paramNodeList_grow (s);
00088 
00089   s->nspace--;
00090   s->elements[s->nelements] = el;
00091   
00092   s->nelements++;
00093   return s;
00094 }

paramNodeList paramNodeList_copy ( paramNodeList s )
 

Definition at line 97 of file paramNodeList.c.

00098 {
00099   paramNodeList r = paramNodeList_new ();
00100 
00101   paramNodeList_elements (s, x)
00102   {
00103     r = paramNodeList_add (r, paramNode_copy (x));
00104   } end_paramNodeList_elements;
00105 
00106   return r;
00107 }

void paramNodeList_free ( paramNodeList s )
 

Definition at line 154 of file paramNodeList.c.

Referenced by typeExpr_free().

00155 {
00156   if (paramNodeList_isDefined (s))
00157     {
00158       int i;
00159       for (i = 0; i < s->nelements; i++)
00160         {
00161           paramNode_free (s->elements[i]); 
00162         }
00163       
00164       sfree (s->elements); 
00165       sfree (s);
00166     }
00167 }

paramNodeList paramNodeList_new ( )
 

Definition at line 36 of file paramNodeList.c.

Referenced by paramNodeList_copy().

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

paramNodeList paramNodeList_single ( paramNode p )
 

Definition at line 49 of file paramNodeList.c.

00050 {
00051   paramNodeList s = (paramNodeList) dmalloc (sizeof (*s));
00052   
00053   s->nelements = 1;
00054   s->nspace = paramNodeListBASESIZE - 1;
00055   s->elements = (paramNode *) dmalloc (sizeof (*s->elements) * paramNodeListBASESIZE);
00056   s->elements[0] = p;
00057 
00058   return (s);
00059 }

cstring paramNodeList_unparse ( paramNodeList s )
 

Definition at line 110 of file paramNodeList.c.

Referenced by iterNode_unparse().

00111 {
00112   bool first = TRUE;
00113   cstring st = cstring_undefined;
00114 
00115   paramNodeList_elements (s, current)
00116   {
00117     if (first)
00118       {
00119         st = paramNode_unparse (current);
00120         first = FALSE;
00121       }
00122     else
00123       {
00124         st = message ("%q, %q", st, paramNode_unparse (current));
00125       }
00126   } end_paramNodeList_elements;
00127 
00128   return st;
00129 }

cstring paramNodeList_unparseComments ( paramNodeList s )
 

Definition at line 132 of file paramNodeList.c.

00133 {
00134   bool first = TRUE;
00135   cstring st = cstring_undefined;
00136 
00137   paramNodeList_elements (s, current)
00138   {
00139     if (first)
00140       {
00141         st = paramNode_unparseComments (current);
00142         first = FALSE;
00143       }
00144     else
00145       {
00146         st = message ("%q, %q", st, paramNode_unparseComments (current));
00147       }
00148   } end_paramNodeList_elements;
00149 
00150   return st;
00151 }


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