Home | History | Annotate | Download | only in libterminfo

Lines Matching refs:tbuf

172 _ti_grow_tbuf(TBUF *tbuf, size_t len)
177 _DIAGASSERT(tbuf != NULL);
179 l = tbuf->bufpos + len;
180 if (l > tbuf->buflen) {
181 if (tbuf->buflen == 0)
184 buf = realloc(tbuf->buf, l);
187 tbuf->buf = buf;
188 tbuf->buflen = l;
190 return tbuf->buf;
194 _ti_find_cap(TIC *tic, TBUF *tbuf, char type, short ind)
200 _DIAGASSERT(tbuf != NULL);
202 cap = tbuf->buf;
203 for (n = tbuf->entries; n > 0; n--) {
226 _ti_find_extra(TIC *tic, TBUF *tbuf, const char *code)
232 _DIAGASSERT(tbuf != NULL);
235 cap = tbuf->buf;
236 for (n = tbuf->entries; n > 0; n--) {
355 _ti_encode_buf(char **cap, const TBUF *buf)
415 encode_string(const char *term, const char *cap, TBUF *tbuf, const char *str,
421 if (_ti_grow_tbuf(tbuf, strlen(str) + 1) == NULL)
423 p = s = tbuf->buf + tbuf->bufpos;
518 tbuf->bufpos += (size_t)(p - s);
557 _ti_encode_buf_id_num(TBUF *tbuf, int ind, int num, size_t len)
559 if (!_ti_grow_tbuf(tbuf, sizeof(uint16_t) + len))
561 _ti_encode_buf_16(tbuf, ind);
563 _ti_encode_buf_32(tbuf, (uint32_t)num);
565 _ti_encode_buf_16(tbuf, (uint16_t)num);
566 tbuf->entries++;
571 _ti_encode_buf_id_count_str(TBUF *tbuf, int ind, const void *buf, size_t len)
573 if (!_ti_grow_tbuf(tbuf, 2 * sizeof(uint16_t) + len))
575 _ti_encode_buf_16(tbuf, ind);
576 _ti_encode_buf_count_str(tbuf, buf, len);
577 tbuf->entries++;
582 _ti_encode_buf_id_flags(TBUF *tbuf, int ind, int flag)
584 if (!_ti_grow_tbuf(tbuf, sizeof(uint16_t) + 1))
586 _ti_encode_buf_16(tbuf, ind);
587 tbuf->buf[tbuf->bufpos++] = flag;
588 tbuf->entries++;
601 TBUF buf;