X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/64e8827c5d5def0325ab7181fe939623c77e807c..d2afe7d6749bc73f88e1fea993de2e0dbb5b3565:/sbr/fmt_compile.c diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 970e71e5..3f170f31 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -1087,6 +1087,25 @@ fmt_appendcomp(int bucket, char *component, char *text) } } +/* + * Iterate over our component hash table + */ + +struct comp * +fmt_nextcomp(struct comp *comp, unsigned int *bucket) +{ + if (comp == NULL) + *bucket = 0; + else + comp = comp->c_next; + + while (comp == NULL && *bucket < sizeof(wantcomp)/sizeof(wantcomp[0])) { + comp = wantcomp[(*bucket)++]; + } + + return comp; +} + /* * Free and reset our component hash table */