1 char rcsid_string
[] = "$Id$";
8 static StrTableElement newStrTableElement
ARGS((void));
13 return (StrTable
) zalloc(sizeof(struct strTable
));
16 static StrTableElement
19 return (StrTableElement
) zalloc(sizeof(struct strTableElement
));
23 dumpStrTable(t
) StrTable t
;
28 printf("Begin StrTable\n");
29 for (e
= t
->elems
; e
; e
= e
->next
) {
30 StrTableElement el
= (StrTableElement
) e
->x
;
31 printf("%s: ", el
->str
);
32 for (r
= el
->erulenos
; r
; r
= r
->next
) {
38 printf("End StrTable\n");
42 addString(t
, s
, eruleno
, new) StrTable t
; char *s
; int eruleno
; int *new;
48 for (l
= t
->elems
; l
; l
= l
->next
) {
49 StrTableElement e
= (StrTableElement
) l
->x
;
52 if (!strcmp(s
, e
->str
)) {
53 e
->erulenos
= newIntList(eruleno
, e
->erulenos
);
58 ste
= newStrTableElement();
59 ste
->erulenos
= newIntList(eruleno
, 0);
60 ste
->str
= (char *) zalloc(strlen(s
) + 1);
62 t
->elems
= newList(ste
, t
->elems
);