File: tinfo.h

package info (click to toggle)
libarr 0.1-52
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 368 kB
  • ctags: 400
  • sloc: ansic: 2,108; makefile: 139; sh: 13
file content (57 lines) | stat: -rw-r--r-- 1,724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * $Id: tinfo.h,v 1.12 2000/11/29 01:53:36 doviende Exp $
 */

#if !defined(__include_tinfo_h__)
#define __include_tinfo_h__

#include <sys/types.h>

#include "types.h"

/* tinfo.h is the terminfo database interface.
 */

/* struct tinfo_entry is an entry from an open terminfo file.  It needs to be
 * used when retrieving terminfo data.
 */
struct tinfo_seek;
extern struct tinfo_entry {
	struct tinfo_seek **seek_list;	/* list of capability offsets */
	u_long offset;			/* offset of entry, relative to start of
					   file. */
	int fd;				/* file descriptor of file */
	struct te_hdr {			/* file header */
		int16_t magic,		/* file magic */
			name_len,	/* length of terminal type string */
			bool_size,	/* size of boolean cap. section */
			num_size,	/* number of integer capabilities */
			str_size,	/* number of string offsets */
			str_table_size;	/* size of string offset table */
	} hdr;
	char *names;			/* list of terminal entries */
	struct te_caps {		/* capabilities */
		int8_t *bool;		/* booleans */
		int16_t *nums;		/* numbers */
		int16_t *str_offsets;	/* string offsets */
		char *str_table;	/* string table */
	} caps;
} *tc_entry;

extern void kill_tc_entry(void);

extern char *tinfo_getstr(struct tinfo_entry *_en, int _offset);
extern int tinfo_getflag(struct tinfo_entry *_en, int _offset);
extern int tinfo_getnum(struct tinfo_entry *_en, int offset);

extern int tinfo_init(char *_term);

/* mbyte_pairs[] is a list of terminals that support multibyte character pairs.
 * tinfo_mbyte_pairs != NULL if the current $TERM is one of mbyte_pairs[].
 */
extern struct mbyte_pair {
	const char *term;	/* $TERM value */
	int r1, r2;		/* range start, end */
} mbyte_pairs[], *term_mbyte_pairs;

#endif