#include "lclintMacros.nf"#include "basic.h"Go to the source code of this file.
Functions | |
| messageLog | messageLog_new () |
| bool | messageLog_add (messageLog s, fileloc fl, cstring mess) |
| cstring | messageLog_unparse (messageLog s) |
| void | messageLog_free (messageLog s) |
|
|
Definition at line 142 of file messageLog.c. 00143 {
00144 msgentry msg = msgentry_create (fl, mess);
00145 int ind, i;
00146
00147 llassert (messageLog_isDefined (s));
00148
00149 ind = messageLog_index (s, msg);
00150
00151 if (ind + 1 < s->nelements)
00152 {
00153 if (msgentry_equal (msg, s->elements[ind + 1]))
00154 {
00155 msgentry_free (msg);
00156 return FALSE;
00157 }
00158 }
00159
00160 if (s->nspace <= 0) {
00161 messageLog_grow (s);
00162 }
00163
00164 for (i = s->nelements; i > ind + 1; i--)
00165 {
00166 s->elements[i] = s->elements[i-1];
00167 }
00168
00169 s->elements[ind + 1] = msg;
00170 s->nspace--;
00171 s->nelements++;
00172
00173 return TRUE;
00174 }
|
|
|
Definition at line 200 of file messageLog.c. Referenced by context_destroyMod(). |
|
|
Definition at line 32 of file messageLog.c. Referenced by context_initMod(). 00033 {
00034 messageLog s = (messageLog) dmalloc (sizeof (*s));
00035
00036 s->nelements = 0;
00037 s->nspace = messageLogBASESIZE;
00038 s->elements = (msgentry *) dmalloc (sizeof (*s->elements) * messageLogBASESIZE);
00039
00040 return (s);
00041 }
|
|
|
Definition at line 177 of file messageLog.c. 00178 {
00179 int i;
00180 cstring st = cstring_makeLiteral ("[");
00181
00182 if (messageLog_isDefined (s))
00183 {
00184 for (i = 0; i < s->nelements; i++)
00185 {
00186 if (i == 0)
00187 {
00188 st = message ("%q %q", st, fileloc_unparseDirect (s->elements[i]->loc));
00189 }
00190 else
00191 st = message ("%q, %q", st, fileloc_unparseDirect (s->elements[i]->loc));
00192 }
00193 }
00194
00195 st = message ("%q ]", st);
00196 return st;
00197 }
|
1.2.3 written by Dimitri van Heesch,
© 1997-2000