Lines Matching refs:buf
58 static char *buf; /* used to hold the source dictionary */
59 static uint_t *offsets; /* array of word-offsets into "buf" */
110 if (fprintf(tmpfp[tmpfp_idx], "%s\n", &buf[offsets[i++]]) < 0) {
156 * translate(buf, size)
159 * words in "buf" and insert each of them into the offsets-array.
166 translate(char *buf, size_t size)
172 e = &buf[size];
175 for (p = buf, q = buf; q < e; q++) {
185 if (p-&buf[wordstart] > MAXWORDLEN)
186 buf[wordstart+MAXWORDLEN-1] = '\0';
189 wordstart = p-buf;
209 return (strcmp(&buf[idx_a], &buf[idx_b]));
249 if ((buf = malloc(statbuf.st_size + 1)) == NULL) {
254 n = read(fd, buf, statbuf.st_size);
266 if (translate(buf, n) == 0) {
276 if (buf != NULL)
277 free(buf);