summaryrefslogtreecommitdiff
path: root/src/tibchar.h
blob: 84c35212be576c66f11df00f1eae36e68c7a4e86 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 *  libtib - Read, write, and evaluate TI BASIC programs
 *  Copyright (C) 2015-2017 Delwink, LLC
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, version 3 only.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DELWINK_TIB_TIBCHAR_H
#define DELWINK_TIB_TIBCHAR_H

#include "tibexpr.h"

enum tib_special_char
{
	/* printing characters */
	TIB_CHAR_DEGREE = 128,
	TIB_CHAR_EPOW10,
	TIB_CHAR_LESSEQUAL,
	TIB_CHAR_GREATEREQUAL,
	TIB_CHAR_L1,
	TIB_CHAR_L2,
	TIB_CHAR_L3,
	TIB_CHAR_L4,
	TIB_CHAR_L5,
	TIB_CHAR_L6,
	TIB_CHAR_L7,
	TIB_CHAR_L8,
	TIB_CHAR_L9,
	TIB_CHAR_PI,
	TIB_CHAR_SMALL1,
	TIB_CHAR_SMALL2,
	TIB_CHAR_SMALL3,
	TIB_CHAR_SMALL4,
	TIB_CHAR_SMALL5,
	TIB_CHAR_SMALL6,
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CL,
	TIB_CHAR_YMAX,
	TIB_CHAR_YMIN,
	TIB_CHAR_YSCL,

	/* meta */
	TIB_FIRST_CHAR = 128,
	TIB_LAST_CHAR = TIB_CHAR_YSCL
};

const char *
tib_special_char_text(int c);

int
tib_encode_str(struct tib_expr *dest, const char *src);

int
tib_keyword_init(void);

void
tib_keyword_free(void);

#endif