Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gdefs.h
Go to the documentation of this file.
1#pragma once
2
3#define Y(i) (1<<(i))
4
5#define V 0x4 /* NODE */
6#define E 0x5 /* EDGE */
7#define G 0x6 /* GRAPH */
8#define O 0x7 /* OBJECT */
9#define TV 0x8 /* TV_ */
10#define YALL (Y(V)|Y(E)|Y(G))
11
12enum {
14#define X(prefix, name, str, type, subtype, ...) prefix##name,
15#include <gvpr/gprdata.inc>
16#undef X
17};
18
19enum { LAST_V = 0
20#define X(prefix, name, str, type, subtype, ...) + (prefix == V_ ? 1 : 0)
21#define V_ 1
22#define M_ 2
23#define T_ 3
24#define A_ 4
25#define F_ 5
26#define C_ 6
27#include <gvpr/gprdata.inc>
28#undef X
29};
30
31enum { LAST_M = 0
32#define X(prefix, name, str, type, subtype, ...) \
33 + ((prefix == V_ || prefix == M_) ? 1 : 0)
34#include <gvpr/gprdata.inc>
35#undef C_
36#undef F_
37#undef A_
38#undef T_
39#undef M_
40#undef V_
41#undef X
42};
43
44enum { MINNAME = 1 };
45
46enum { MAXNAME = 0
47#define X(prefix, name, str, type, subtype, ...) + 1
48#include <gvpr/gprdata.inc>
49#undef X
50};
51
52static Exid_t symbols[] = {
53#define X(prefix, name, str, type, subtype, ...) \
54 EX_ID(str, type, prefix##name, subtype),
55#include <gvpr/gprdata.inc>
56#undef X
57 EX_ID({0}, 0, 0, 0),
58};
59
60static char* typenames[] = {
61#define X(prefix, name, str, type, subtype, ...) type ## _(str)
62#define ID_(str) // nothing
63#define DECLARE_(str) str,
64#define ARRAY_(str) // nothing
65#define FUNCTION_(str) // nothing
66#define CONSTANT_(str) // nothing
67#include <gvpr/gprdata.inc>
68#undef CONSTANT_
69#undef FUNCTION_
70#undef ARRAY_
71#undef DECLARE_
72#undef ID_
73#undef X
74};
75
76#ifdef DEBUG
77static char* gprnames[] = {
78 "",
79#define X(prefix, name, str, type, subtype, ...) str,
80#include <gvpr/gprdata.inc>
81#undef X
82};
83#endif
84
85typedef unsigned short tctype;
86
87static tctype tchk[][2] = {
88 {0, 0},
89#define X(prefix, name, str, type, subtype, ...) type ## _(__VA_ARGS__)
90#define ID_(...) { __VA_ARGS__ },
91#define DECLARE_() // nothing
92#define ARRAY_() // nothing
93#define FUNCTION_() // nothing
94#define CONSTANT_() // nothing
95#include <gvpr/gprdata.inc>
96#undef CONSTANT_
97#undef FUNCTION_
98#undef ARRAY_
99#undef DECLARE_
100#undef ID_
101#undef X
102};
#define EX_ID(n, l, i, t)
Definition expr.h:53
@ MAXNAME
Definition gdefs.h:46
static Exid_t symbols[]
Definition gdefs.h:52
@ RESERVED
Definition gdefs.h:13
@ LAST_M
Definition gdefs.h:31
static char * typenames[]
Definition gdefs.h:60
@ MINNAME
Definition gdefs.h:44
static tctype tchk[][2]
Definition gdefs.h:87
unsigned short tctype
Definition gdefs.h:85
@ LAST_V
Definition gdefs.h:19
Definition expr.h:93