#include "lclintMacros.nf"#include "basic.h"Go to the source code of this file.
Functions | |
| enumNameList | enumNameList_new () |
| enumNameList | enumNameList_single ( enumName t) |
| bool | enumNameList_match (enumNameList e1, enumNameList e2) |
| void | enumNameList_addh (enumNameList s, enumName el) |
| enumNameList | enumNameList_push ( enumNameList s, enumName el) |
| enumNameList | enumNameList_copy (enumNameList s) |
| bool | enumNameList_member (enumNameList s, cstring m) |
| enumNameList | enumNameList_subtract (enumNameList source, enumNameList del) |
| cstring | enumNameList_unparse (enumNameList s) |
| cstring | enumNameList_unparseBrief (enumNameList s) |
| cstring | enumNameList_dump (enumNameList s) |
| enumNameList | enumNameList_undump (d_char *s) |
| void | enumNameList_free (enumNameList s) |
|
|
Definition at line 102 of file enumNameList.c. Referenced by enumNameList_copy(), enumNameList_push(), enumNameList_subtract(), and enumNameList_undump(). 00103 {
00104 if (s->nspace <= 0)
00105 enumNameList_grow (s);
00106
00107 s->nspace--;
00108 s->elements[s->nelements] = el;
00109 s->nelements++;
00110 }
|
|
|
Definition at line 120 of file enumNameList.c. 00121 {
00122 enumNameList r = enumNameList_new ();
00123
00124 enumNameList_elements (s, x)
00125 {
00126 enumNameList_addh (r, cstring_copy (x));
00127 } end_enumNameList_elements;
00128
00129 return r;
00130 }
|
|
|
Definition at line 206 of file enumNameList.c. 00207 {
00208 int i;
00209 cstring st = cstring_undefined;
00210
00211 for (i = 0; i < s->nelements; i++)
00212 {
00213 if (i == 0)
00214 {
00215 st = cstring_copy (s->elements[i]);
00216 }
00217 else
00218 st = message ("%q,%s", st, s->elements[i]);
00219 }
00220 return st;
00221 }
|
|
|
Definition at line 261 of file enumNameList.c. Referenced by declareUnnamedEnum(). 00262 {
00263 int i;
00264
00265
00266 for (i = 0; i < s->nelements; i++)
00267 {
00268 cstring_free (s->elements[i]);
00269 }
00270
00271 sfree (s->elements);
00272 sfree (s);
00273 }
|
|
|
Definition at line 64 of file enumNameList.c. Referenced by usymtab_enumEnumNameListType(). 00065 {
00066 int i;
00067
00068 if (e1->nelements != e2->nelements) return FALSE;
00069
00070 for (i = 0; i < e1->nelements; i++)
00071 {
00072 if (!cstring_equal (e1->elements[i], e2->elements[i]))
00073 return FALSE;
00074 }
00075 return TRUE;
00076 }
|
|
|
Definition at line 133 of file enumNameList.c. Referenced by enumNameList_subtract(). 00134 {
00135 enumNameList_elements (s, x)
00136 {
00137 if (cstring_equal (m, x)) return TRUE;
00138 } end_enumNameList_elements;
00139
00140 return FALSE;
00141 }
|
|
|
Definition at line 38 of file enumNameList.c. Referenced by enumNameList_copy(), enumNameList_subtract(), and enumNameList_undump(). 00039 {
00040 enumNameList s = (enumNameList) dmalloc (sizeof (*s));
00041
00042 s->nelements = 0;
00043 s->nspace = enumNameListBASESIZE;
00044 s->elements = (enumName *)
00045 dmalloc (sizeof (*s->elements) * enumNameListBASESIZE);
00046
00047 return (s);
00048 }
|
|
|
Definition at line 113 of file enumNameList.c. 00114 {
00115 enumNameList_addh (s, el);
00116 return s;
00117 }
|
|
|
Definition at line 51 of file enumNameList.c. 00052 {
00053 enumNameList s = (enumNameList) dmalloc (sizeof (*s));
00054
00055 s->nelements = 1;
00056 s->nspace = enumNameListBASESIZE - 1;
00057 s->elements = (enumName *) dmalloc (sizeof (*s->elements) * enumNameListBASESIZE);
00058 s->elements[0] = t;
00059
00060 return (s);
00061 }
|
|
|
Definition at line 144 of file enumNameList.c. 00145 {
00146 enumNameList ret = enumNameList_new ();
00147
00148 enumNameList_elements (source, el)
00149 {
00150 if (!enumNameList_member (del, el))
00151 {
00152 enumNameList_addh (ret, cstring_copy (el));
00153 }
00154 } end_enumNameList_elements;
00155
00156 return ret;
00157 }
|
|
|
Definition at line 224 of file enumNameList.c. 00225 {
00226 enumNameList e = enumNameList_new ();
00227
00228 if (**s == '}')
00229 (*s)++;
00230 else
00231 {
00232 while (TRUE)
00233 {
00234 char *t = strchr (*s, ',');
00235 char mt;
00236
00237 if (t == NULL)
00238 {
00239 t = strchr (*s, '}');
00240
00241 if (t == NULL)
00242 {
00243 llcontbug (message ("enumNameList_undump: bad line: %s", cstring_fromChars (*s)));
00244 return e;
00245 }
00246 }
00247
00248 mt = *t;
00249 *t = '\0';
00250
00251 enumNameList_addh (e, cstring_fromChars (mstring_copy (*s)));
00252 *s = t + 1;
00253 if (mt == '}')
00254 break;
00255 }
00256 }
00257 return e;
00258 }
|
|
|
Definition at line 160 of file enumNameList.c. 00161 {
00162 int i;
00163 cstring st = cstring_undefined;
00164
00165 for (i = 0; i < s->nelements; i++)
00166 {
00167 if (i == 0)
00168 {
00169 st = cstring_copy (s->elements[i]);
00170 }
00171 else
00172 {
00173 st = message ("%q, %s", st, s->elements[i]);
00174 }
00175 }
00176
00177 return st;
00178 }
|
|
|
Definition at line 180 of file enumNameList.c. 00181 {
00182 int i;
00183 cstring st = cstring_undefined;
00184
00185 for (i = 0; i < s->nelements; i++)
00186 {
00187 if (i == 0)
00188 {
00189 st = cstring_copy (s->elements[i]);
00190 }
00191 else if (i == 3 && s->nelements > 5)
00192 {
00193 st = message ("%q, ...", st);
00194 i = s->nelements - 2;
00195 }
00196 else
00197 {
00198 st = message ("%q, %s", st, s->elements[i]);
00199 }
00200 }
00201
00202 return st;
00203 }
|
1.2.3 written by Dimitri van Heesch,
© 1997-2000