Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
sftable.c
Go to the documentation of this file.
1
/*************************************************************************
2
* Copyright (c) 2011 AT&T Intellectual Property
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* https://www.eclipse.org/legal/epl-v10.html
7
*
8
* Contributors: Details at https://graphviz.org
9
*************************************************************************/
10
11
#include <limits.h>
12
#include <
sfio/sfhdr.h
>
13
#include <stddef.h>
14
#include <
util/gv_ctype.h
>
15
16
/* Dealing with $ argument addressing stuffs.
17
**
18
** Written by Kiem-Phong Vo.
19
*/
20
21
static
char
*
sffmtint
(
const
char
*
str
,
int
*v)
22
{
23
for
(*v = 0;
gv_isdigit
(*
str
); ++
str
)
24
*v = *v * 10 + (*
str
-
'0'
);
25
*v -= 1;
26
return
(
char
*)
str
;
27
}
28
29
/* table for floating point and integer conversions */
30
Sftab_t
_Sftable
= {
31
.
sf_pos10
= {1e1, 1e2, 1e4, 1e8, 1e16, 1e32},
32
.sf_neg10 = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32},
33
34
.sf_dec =
35
{
'0'
,
'0'
,
'0'
,
'1'
,
'0'
,
'2'
,
'0'
,
'3'
,
'0'
,
'4'
,
36
'0'
,
'5'
,
'0'
,
'6'
,
'0'
,
'7'
,
'0'
,
'8'
,
'0'
,
'9'
,
37
'1'
,
'0'
,
'1'
,
'1'
,
'1'
,
'2'
,
'1'
,
'3'
,
'1'
,
'4'
,
38
'1'
,
'5'
,
'1'
,
'6'
,
'1'
,
'7'
,
'1'
,
'8'
,
'1'
,
'9'
,
39
'2'
,
'0'
,
'2'
,
'1'
,
'2'
,
'2'
,
'2'
,
'3'
,
'2'
,
'4'
,
40
'2'
,
'5'
,
'2'
,
'6'
,
'2'
,
'7'
,
'2'
,
'8'
,
'2'
,
'9'
,
41
'3'
,
'0'
,
'3'
,
'1'
,
'3'
,
'2'
,
'3'
,
'3'
,
'3'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ADIX
,
SF_RADIX
,
SF_RADIX
,
64
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
65
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
66
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
67
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
68
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
69
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
70
0, 1, 2, 3, 4, 5,
71
6, 7, 8, 9,
SF_RADIX
,
SF_RADIX
,
72
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
, 62, 10,
73
11, 12, 13, 14, 15, 16,
74
17, 18, 19, 20, 21, 22,
75
23, 24, 25, 26, 27, 28,
76
29, 30, 31, 32, 33, 34,
77
35,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
, 63,
78
SF_RADIX
, 10, 11, 12, 13, 14,
79
15, 16, 17, 18, 19, 20,
80
21, 22, 23, 24, 25, 26,
81
27, 28, 29, 30, 31, 32,
82
33, 34, 35,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
83
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
84
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
85
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
86
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
87
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
88
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
89
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
90
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
91
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
92
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
93
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
94
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
95
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
96
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
97
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
98
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
99
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
100
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
101
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
102
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
103
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
104
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
105
},
106
.sf_cv64 =
107
{
108
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
109
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
110
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
111
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
112
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
113
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
114
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
115
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
116
0, 1, 2, 3, 4, 5,
117
6, 7, 8, 9,
SF_RADIX
,
SF_RADIX
,
118
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
, 62, 36,
119
37, 38, 39, 40, 41, 42,
120
43, 44, 45, 46, 47, 48,
121
49, 50, 51, 52, 53, 54,
122
55, 56, 57, 58, 59, 60,
123
61,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
, 63,
124
SF_RADIX
, 10, 11, 12, 13, 14,
125
15, 16, 17, 18, 19, 20,
126
21, 22, 23, 24, 25, 26,
127
27, 28, 29, 30, 31, 32,
128
33, 34, 35,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
129
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
130
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
131
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
132
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
133
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
134
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
135
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
136
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
137
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
138
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
139
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
140
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
141
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
142
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
143
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
144
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
145
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
146
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
147
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
148
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
149
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
150
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
SF_RADIX
,
151
},
152
.sf_type = {
153
[
'd'
] =
SFFMT_INT
,
154
[
'i'
] =
SFFMT_INT
,
155
[
'u'
] =
SFFMT_UINT
,
156
[
'o'
] =
SFFMT_UINT
,
157
[
'x'
] =
SFFMT_UINT
,
158
[
'X'
] =
SFFMT_UINT
,
159
[
'e'
] =
SFFMT_FLOAT
,
160
[
'E'
] =
SFFMT_FLOAT
,
161
[
'g'
] =
SFFMT_FLOAT
,
162
[
'G'
] =
SFFMT_FLOAT
,
163
[
'f'
] =
SFFMT_FLOAT
,
164
[
's'
] =
SFFMT_POINTER
,
165
[
'n'
] =
SFFMT_POINTER
,
166
[
'p'
] =
SFFMT_POINTER
,
167
[
'!'
] =
SFFMT_POINTER
,
168
[
'c'
] =
SFFMT_BYTE
,
169
[
'['
] =
SFFMT_CLASS
,
170
}
171
};
gv_ctype.h
replacements for ctype.h functions
gv_isdigit
static bool gv_isdigit(int c)
Definition
gv_ctype.h:41
str
textitem scanner parser str
Definition
htmlparse.y:224
sfhdr.h
SFFMT_CLASS
#define SFFMT_CLASS
Definition
sfhdr.h:117
SFFMT_POINTER
#define SFFMT_POINTER
Definition
sfhdr.h:116
SFFMT_BYTE
#define SFFMT_BYTE
Definition
sfhdr.h:115
SF_RADIX
#define SF_RADIX
Definition
sfhdr.h:119
SFFMT_INT
#define SFFMT_INT
Definition
sfhdr.h:112
SFFMT_UINT
#define SFFMT_UINT
Definition
sfhdr.h:113
SFFMT_FLOAT
#define SFFMT_FLOAT
Definition
sfhdr.h:114
_Sftable
Sftab_t _Sftable
Definition
sftable.c:30
sffmtint
static char * sffmtint(const char *str, int *v)
Definition
sftable.c:21
_sftab_
Definition
sfhdr.h:137
_sftab_::sf_pos10
long double sf_pos10[SF_MAXEXP10]
positive powers of 10
Definition
sfhdr.h:138
lib
sfio
sftable.c
Generated by
1.9.8