viric@11: #include viric@11: #include "dictre.h" viric@11: viric@11: static void new_word(const char *str) viric@11: { viric@11: printf("%s\n", str); viric@11: } viric@11: viric@11: viric@11: void zprocess_def(const char *root, char *def) viric@11: { viric@11: int index = 0; viric@11: int res; viric@11: /* Jump the first line (index word) Wait for \n */ viric@11: skip_newline(def, &index); viric@11: ++index; viric@11: viric@11: res = until_newword(def, &index); viric@11: if (res == -1) viric@11: return; viric@11: viric@11: /* Mark words */ viric@11: do { viric@11: int end; viric@11: end = index; viric@11: res = until_noword(def, &end); viric@11: if (res == -1) viric@11: break; viric@11: def[end] = 0; viric@11: insert_word(&def[index], root); viric@11: index = end+1; viric@11: res = until_newword(def,&index); viric@11: if (res == -1) viric@11: break; viric@11: } while (1); viric@11: free(def); viric@11: free(root); viric@11: }