Lines Matching defs:tabp
45 md_tab_t *tabp
50 Free(tabp->filename);
51 Free(tabp->data);
52 if (tabp->lines != NULL) {
53 assert(tabp->alloc > 0);
54 for (line = 0; (line < tabp->nlines); ++line) {
55 md_tab_line_t *linep = &tabp->lines[line];
66 Free(tabp->lines);
68 Free(tabp);
107 md_tab_t *tabp,
113 if (nlines < tabp->alloc)
117 if (tabp->alloc == 0) {
118 assert(tabp->lines == NULL);
119 tabp->lines = Malloc(nlines * sizeof (*tabp->lines));
121 assert(tabp->lines != NULL);
122 tabp->lines =
123 Realloc(tabp->lines, (nlines * sizeof (*tabp->lines)));
127 (void) memset(&tabp->lines[tabp->alloc], 0,
128 ((nlines - tabp->alloc) * sizeof (*tabp->lines)));
131 tabp->alloc = nlines;
139 md_tab_t *tabp,
145 char *p = tabp->data;
146 char *e = tabp->data + tabp->total - 1;
151 assert(tabp->total >= 2);
152 assert(tabp->data[tabp->total - 2] == '\n');
153 assert(tabp->data[tabp->total - 1] == '\0');
156 assert(tabp->filename != NULL);
157 len = strlen(tabp->filename) +
167 realloc_lines(tabp, (tabp->nlines + 1));
168 linep = &tabp->lines[tabp->nlines];
170 dgettext(TEXT_DOMAIN, "%s line %u"), tabp->filename,
226 tabp->nlines++;
255 md_tab_t *tabp = NULL;
274 tabp = Zalloc(sizeof (*tabp));
275 tabp->filename = Strdup(filename);
276 tabp->total = statbuf.st_size + 2; /* terminating "\n\0" */
277 tabp->data = Malloc(tabp->total);
281 p = tabp->data;
295 tabp->data[tabp->total - 2] = '\n';
296 tabp->data[tabp->total - 1] = '\0';
307 parse_tab(tabp, filename, ep);
311 return (tabp);
317 if (tabp != NULL)
318 meta_tab_free(tabp);
328 md_tab_t *tabp,
340 for (line = 0; (line < tabp->nlines); ++line) {
341 md_tab_line_t *linep = &tabp->lines[line];