+ if (!(r = sscanf(p, "%511[^:,]:%511[^,]", attname,
+ structure)))
+ {
+ logf(LOG_WARN, "Syntax error in termlistspec in %s",
+ file);
+ fclose(f);
+ return 0;
+ }
+ *tp = nmem_malloc(data1_nmem_get(dh), sizeof(**tp));
+ if (!((*tp)->att = data1_getattbyname (dh, res->attset,
+ attname)))
+ {
+ logf(LOG_WARN, "Couldn't find att '%s' in attset",
+ attname);
+ fclose(f);
+ return 0;
+ }
+ if (r < 2) /* is the structure qualified? */
+ (*tp)->structure = DATA1S_word;
+ else if (!data1_matchstr(structure, "w"))
+ (*tp)->structure = DATA1S_word;
+ else if (!data1_matchstr(structure, "p"))
+ (*tp)->structure = DATA1S_phrase;
+
+ (*tp)->next = 0;
+ tp = &(*tp)->next;
+ }
+ while ((p = strchr(p, ',')) && *(++p));