-
Notifications
You must be signed in to change notification settings - Fork 635
Expand file tree
/
Copy pathsfprocs.h
More file actions
210 lines (198 loc) · 6.34 KB
/
Copy pathsfprocs.h
File metadata and controls
210 lines (198 loc) · 6.34 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/* NetHack 3.6 sfprocs.h Tue Nov 6 19:38:48 2018 */
/* Copyright (c) NetHack Development Team 2025. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SFPROCS_H
#define SFPROCS_H
#define NHTYPE_SIMPLE 1
#define NHTYPE_COMPLEX 2
#define SF_PROTO(dtyp) \
extern void sfo_##dtyp(NHFILE *, dtyp *, const char *); \
extern void sfi_##dtyp(NHFILE *, dtyp *, const char *); \
extern void sfo_x_##dtyp(NHFILE *, dtyp *, const char *); \
extern void sfi_x_##dtyp(NHFILE *, dtyp *, const char *)
#define SF_PROTO_C(keyw, dtyp) \
extern void sfo_##dtyp(NHFILE *, keyw dtyp *, const char *); \
extern void sfi_##dtyp(NHFILE *, keyw dtyp *, const char *); \
extern void sfo_x_##dtyp(NHFILE *, keyw dtyp *, const char *); \
extern void sfi_x_##dtyp(NHFILE *, keyw dtyp *, const char *)
#define SF_PROTO_X(xxx, dtyp) \
extern void sfo_##dtyp(NHFILE *, xxx *, const char *, int bfsz); \
extern void sfi_##dtyp(NHFILE *, xxx *, const char *, int bfsz); \
extern void sfo_x_##dtyp(NHFILE *, xxx *, const char *, int bfsz); \
extern void sfi_x_##dtyp(NHFILE *, xxx *, const char *, int bfsz)
SF_PROTO_C(struct, arti_info);
SF_PROTO_C(struct, nhrect);
SF_PROTO_C(struct, branch);
SF_PROTO_C(struct, bubble);
SF_PROTO_C(struct, cemetery);
SF_PROTO_C(struct, context_info);
SF_PROTO_C(struct, nhcoord);
SF_PROTO_C(struct, damage);
SF_PROTO_C(struct, dest_area);
SF_PROTO_C(struct, dgn_topology);
SF_PROTO_C(struct, dungeon);
SF_PROTO_C(struct, d_level);
SF_PROTO_C(struct, ebones);
SF_PROTO_C(struct, edog);
SF_PROTO_C(struct, egd);
SF_PROTO_C(struct, emin);
SF_PROTO_C(struct, engr);
SF_PROTO_C(struct, epri);
SF_PROTO_C(struct, eshk);
SF_PROTO_C(struct, fe);
SF_PROTO_C(struct, flag);
SF_PROTO_C(struct, fruit);
SF_PROTO_C(struct, gamelog_line);
SF_PROTO_C(struct, kinfo);
SF_PROTO_C(struct, levelflags);
SF_PROTO_C(struct, ls_t);
SF_PROTO_C(struct, linfo);
SF_PROTO_C(struct, mapseen_feat);
SF_PROTO_C(struct, mapseen_flags);
SF_PROTO_C(struct, mapseen_rooms);
SF_PROTO_C(struct, mkroom);
SF_PROTO_C(struct, monst);
SF_PROTO_C(struct, mvitals);
SF_PROTO_C(struct, obj);
SF_PROTO_C(struct, objclass);
SF_PROTO_C(struct, q_score);
SF_PROTO_C(struct, rm);
SF_PROTO_C(struct, spell);
SF_PROTO_C(struct, stairway);
SF_PROTO_C(struct, s_level);
SF_PROTO_C(struct, trap);
SF_PROTO_C(struct, version_info);
SF_PROTO_C(struct, you);
SF_PROTO_C(union, any);
#ifdef DEMO_UPLIFTS
SF_PROTO_C(struct, mystruct);
SF_PROTO_C(struct, mystruct_rev0);
#endif
SF_PROTO(int16);
SF_PROTO(int32);
SF_PROTO(int64);
SF_PROTO(uchar);
SF_PROTO(uint16);
SF_PROTO(uint32);
SF_PROTO(uint64);
SF_PROTO(long);
SF_PROTO(ulong);
SF_PROTO(xint8);
SF_PROTO(boolean);
SF_PROTO(schar);
SF_PROTO(aligntyp);
SF_PROTO(genericptr);
SF_PROTO(size_t);
SF_PROTO(time_t);
SF_PROTO(int);
SF_PROTO(unsigned);
SF_PROTO(coordxy);
SF_PROTO(short);
SF_PROTO(xint16);
SF_PROTO(ushort);
SF_PROTO_X(uint8_t, bitfield);
SF_PROTO_X(char, char);
#undef SF_PROTO
#undef SF_PROTO_C
#undef SF_PROTO_X
#define SF_ENTRY(dtyp) \
void (*sf_##dtyp)(NHFILE *, dtyp *, const char *)
#define SF_ENTRY_C(keyw, dtyp) \
void (*sf_##dtyp)(NHFILE *, keyw dtyp *, const char *)
#define SF_ENTRY_X(xxx, dtyp) \
void (*sf_##dtyp)(NHFILE *, xxx *, const char *, int bfsz)
struct sf_procs {
SF_ENTRY_C(struct, arti_info);
SF_ENTRY_C(struct, nhrect);
SF_ENTRY_C(struct, branch);
SF_ENTRY_C(struct, bubble);
SF_ENTRY_C(struct, cemetery);
SF_ENTRY_C(struct, context_info);
SF_ENTRY_C(struct, nhcoord);
SF_ENTRY_C(struct, damage);
SF_ENTRY_C(struct, dest_area);
SF_ENTRY_C(struct, dgn_topology);
SF_ENTRY_C(struct, dungeon);
SF_ENTRY_C(struct, d_level);
SF_ENTRY_C(struct, ebones);
SF_ENTRY_C(struct, edog);
SF_ENTRY_C(struct, egd);
SF_ENTRY_C(struct, emin);
SF_ENTRY_C(struct, engr);
SF_ENTRY_C(struct, epri);
SF_ENTRY_C(struct, eshk);
SF_ENTRY_C(struct, fe);
SF_ENTRY_C(struct, flag);
SF_ENTRY_C(struct, fruit);
SF_ENTRY_C(struct, gamelog_line);
SF_ENTRY_C(struct, kinfo);
SF_ENTRY_C(struct, levelflags);
SF_ENTRY_C(struct, ls_t);
SF_ENTRY_C(struct, linfo);
SF_ENTRY_C(struct, mapseen_feat);
SF_ENTRY_C(struct, mapseen_flags);
SF_ENTRY_C(struct, mapseen_rooms);
SF_ENTRY_C(struct, mkroom);
SF_ENTRY_C(struct, monst);
SF_ENTRY_C(struct, mvitals);
SF_ENTRY_C(struct, obj);
SF_ENTRY_C(struct, objclass);
SF_ENTRY_C(struct, q_score);
SF_ENTRY_C(struct, rm);
SF_ENTRY_C(struct, spell);
SF_ENTRY_C(struct, stairway);
SF_ENTRY_C(struct, s_level);
SF_ENTRY_C(struct, trap);
SF_ENTRY_C(struct, version_info);
SF_ENTRY_C(struct, you);
SF_ENTRY_C(union, any);
#ifdef DEMO_UPLIFTS
SF_ENTRY_C(struct, mystruct);
SF_ENTRY_C(struct, mystruct_rev0);
#endif
SF_ENTRY(aligntyp);
SF_ENTRY(boolean);
SF_ENTRY(coordxy);
SF_ENTRY(genericptr);
SF_ENTRY(int);
SF_ENTRY(int16);
SF_ENTRY(int32);
SF_ENTRY(int64);
SF_ENTRY(long);
SF_ENTRY(schar);
SF_ENTRY(short);
SF_ENTRY(size_t);
SF_ENTRY(time_t);
SF_ENTRY(uchar);
SF_ENTRY(uint16);
SF_ENTRY(uint32);
SF_ENTRY(uint64);
SF_ENTRY(ulong);
SF_ENTRY(unsigned);
SF_ENTRY(ushort);
SF_ENTRY(xint16);
SF_ENTRY(xint8);
SF_ENTRY_X(char, char);
SF_ENTRY_X(uint8_t, bitfield);
};
#undef SF_ENTRY
#undef SF_ENTRY_C
#undef SF_ENTRY_X
struct sf_structlevel_procs {
const char *ext;
struct sf_procs fn; /* called for structlevel (historical) */
};
struct sf_fieldlevel_procs {
const char *ext;
struct sf_procs fn_x; /* called for fieldlevel */
};
extern struct sf_structlevel_procs sfoprocs[NUM_SAVEFORMATS], sfiprocs[NUM_SAVEFORMATS];
extern void sf_setprocs(int, struct sf_structlevel_procs *, struct sf_structlevel_procs *);
extern void sf_setflprocs(int, struct sf_fieldlevel_procs *, struct sf_fieldlevel_procs *);
extern struct sf_structlevel_procs sfoprocs[NUM_SAVEFORMATS], sfiprocs[NUM_SAVEFORMATS];
extern struct sf_fieldlevel_procs sfoflprocs[NUM_SAVEFORMATS], sfiflprocs[NUM_SAVEFORMATS];
extern struct sf_structlevel_procs historical_sfo_procs;
extern struct sf_structlevel_procs historical_sfi_procs;
extern struct sf_fieldlevel_procs exportascii_sfo_procs;
extern struct sf_fieldlevel_procs exportascii_sfi_procs;
#endif /* SFPROCS_H */