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

sortList.c File Reference

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

Go to the source code of this file.

Functions

sortList sortList_new ()
void sortList_addh (sortList s, sort el)
void sortList_reset (sortList s)
void sortList_advance (sortList s)
sort sortList_current (sortList s)
cstring sortList_unparse (sortList s)
void sortList_free (sortList s)


Function Documentation

void sortList_addh ( sortList s,
sort el )
 

Definition at line 73 of file sortList.c.

Referenced by enteringFcnScope(), and sigNode_domain().

00074 {
00075   if (s->nspace <= 0)
00076     sortList_grow (s);
00077 
00078   s->nspace--;
00079   s->elements[s->nelements] = el;
00080   s->nelements++;
00081 }

void sortList_advance ( sortList s )
 

Definition at line 90 of file sortList.c.

00091 {
00092   s->current++;
00093   llassert (s->current < s->nelements);
00094 }

sort sortList_current ( sortList s )
 

Definition at line 97 of file sortList.c.

00098 {
00099   if (s->current < 0 || s->current >= s->nelements)
00100     {
00101       llbug (message ("sortList_current: current out of range: %d (size: %d)",
00102                       s->current, s->nelements));
00103     }
00104   return (s->elements[s->current]);
00105 }

void sortList_free ( sortList s )
 

Definition at line 129 of file sortList.c.

Referenced by signNode_free().

00130 {
00131   int i;
00132   for (i = 0; i < s->nelements; i++)
00133     {
00134       /*      sort_free (s->elements[i]); */
00135     }
00136   
00137   sfree (s->elements);          /* not quite!!! */
00138   sfree (s);
00139 }

sortList sortList_new ( )
 

Definition at line 36 of file sortList.c.

Referenced by enteringFcnScope(), and sigNode_domain().

00037 {
00038   sortList s = (sortList) dmalloc (sizeof (*s));
00039   
00040   s->nelements = 0;
00041   s->nspace = sortListBASESIZE;
00042   s->elements = (sort *) dmalloc (sizeof (*s->elements) * sortListBASESIZE);
00043   s->current = 0;
00044 
00045   return (s);
00046 }

void sortList_reset ( sortList s )
 

Definition at line 84 of file sortList.c.

00085 {
00086   s->current = 0;
00087 }

cstring sortList_unparse ( sortList s )
 

Definition at line 108 of file sortList.c.

00109 {
00110   int i;
00111   cstring st = cstring_undefined;
00112 
00113   for (i = 0; i < s->nelements; i++)
00114     {
00115       if (i == 0)
00116         {
00117           st = cstring_copy (sort_unparseName (s->elements[i])); /* !!! NEED COPY HERE !!! */
00118         }
00119       else
00120         {
00121           st = message ("%q, %s", st, sort_unparseName (s->elements[i]));
00122         }
00123     }
00124 
00125   return st;
00126 }


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