Source:NetHack 5.0.0/include/sfprocs.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to sfprocs.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/sfprocs.h#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 3.6 sfprocs.h	Tue Nov  6 19:38:48 2018 */
2. /* Copyright (c) NetHack Development Team 2025.                   */
3. /* NetHack may be freely redistributed.  See license for details. */
4. 
5. #ifndef SFPROCS_H
6. #define SFPROCS_H
7. 
8. #define NHTYPE_SIMPLE    1
9. #define NHTYPE_COMPLEX   2
10. 
11. #define SF_PROTO(dtyp) \
12.     extern void sfo_##dtyp(NHFILE *, dtyp *, const char *);   \
13.     extern void sfi_##dtyp(NHFILE *, dtyp *, const char *);   \
14.     extern void sfo_x_##dtyp(NHFILE *, dtyp *, const char *); \
15.     extern void sfi_x_##dtyp(NHFILE *, dtyp *, const char *)
16. #define SF_PROTO_C(keyw, dtyp) \
17.     extern void sfo_##dtyp(NHFILE *, keyw dtyp *, const char *);   \
18.     extern void sfi_##dtyp(NHFILE *, keyw dtyp *, const char *);   \
19.     extern void sfo_x_##dtyp(NHFILE *, keyw dtyp *, const char *); \
20.     extern void sfi_x_##dtyp(NHFILE *, keyw dtyp *, const char *)
21. #define SF_PROTO_X(xxx, dtyp) \
22.     extern void sfo_##dtyp(NHFILE *, xxx *, const char *, int bfsz);   \
23.     extern void sfi_##dtyp(NHFILE *, xxx *, const char *, int bfsz);   \
24.     extern void sfo_x_##dtyp(NHFILE *, xxx *, const char *, int bfsz); \
25.     extern void sfi_x_##dtyp(NHFILE *, xxx *, const char *, int bfsz)
26. 
27. SF_PROTO_C(struct, arti_info);
28. SF_PROTO_C(struct, nhrect);
29. SF_PROTO_C(struct, branch);
30. SF_PROTO_C(struct, bubble);
31. SF_PROTO_C(struct, cemetery);
32. SF_PROTO_C(struct, context_info);
33. SF_PROTO_C(struct, nhcoord);
34. SF_PROTO_C(struct, damage);
35. SF_PROTO_C(struct, dest_area);
36. SF_PROTO_C(struct, dgn_topology);
37. SF_PROTO_C(struct, dungeon);
38. SF_PROTO_C(struct, d_level);
39. SF_PROTO_C(struct, ebones);
40. SF_PROTO_C(struct, edog);
41. SF_PROTO_C(struct, egd);
42. SF_PROTO_C(struct, emin);
43. SF_PROTO_C(struct, engr);
44. SF_PROTO_C(struct, epri);
45. SF_PROTO_C(struct, eshk);
46. SF_PROTO_C(struct, fe);
47. SF_PROTO_C(struct, flag);
48. SF_PROTO_C(struct, fruit);
49. SF_PROTO_C(struct, gamelog_line);
50. SF_PROTO_C(struct, kinfo);
51. SF_PROTO_C(struct, levelflags);
52. SF_PROTO_C(struct, ls_t);
53. SF_PROTO_C(struct, linfo);
54. SF_PROTO_C(struct, mapseen_feat);
55. SF_PROTO_C(struct, mapseen_flags);
56. SF_PROTO_C(struct, mapseen_rooms);
57. SF_PROTO_C(struct, mkroom);
58. SF_PROTO_C(struct, monst);
59. SF_PROTO_C(struct, mvitals);
60. SF_PROTO_C(struct, obj);
61. SF_PROTO_C(struct, objclass);
62. SF_PROTO_C(struct, q_score);
63. SF_PROTO_C(struct, rm);
64. SF_PROTO_C(struct, spell);
65. SF_PROTO_C(struct, stairway);
66. SF_PROTO_C(struct, s_level);
67. SF_PROTO_C(struct, trap);
68. SF_PROTO_C(struct, version_info);
69. SF_PROTO_C(struct, you);
70. SF_PROTO_C(union, any);
71. SF_PROTO(int16);
72. SF_PROTO(int32);
73. SF_PROTO(int64);
74. SF_PROTO(uchar);
75. SF_PROTO(uint16);
76. SF_PROTO(uint32);
77. SF_PROTO(uint64);
78. SF_PROTO(long);
79. SF_PROTO(ulong);
80. SF_PROTO(xint8);
81. SF_PROTO(boolean);
82. SF_PROTO(schar);
83. SF_PROTO(aligntyp);
84. SF_PROTO(genericptr);
85. SF_PROTO(size_t);
86. SF_PROTO(time_t);
87. SF_PROTO(int);
88. SF_PROTO(unsigned);
89. SF_PROTO(coordxy);
90. SF_PROTO(short);
91. SF_PROTO(xint16);
92. SF_PROTO(ushort);
93. SF_PROTO_X(uint8_t, bitfield);
94. SF_PROTO_X(char, char);
95. 
96. #undef SF_PROTO
97. #undef SF_PROTO_C
98. #undef SF_PROTO_X
99. 
100. #define SF_ENTRY(dtyp)                                 \
101.     void (*sf_##dtyp)(NHFILE *, dtyp *, const char *)
102. #define SF_ENTRY_C(keyw, dtyp)                              \
103.     void (*sf_##dtyp)(NHFILE *, keyw dtyp *, const char *)
104. #define SF_ENTRY_X(xxx, dtyp)                                   \
105.     void (*sf_##dtyp)(NHFILE *, xxx *, const char *, int bfsz)
106. 
107. struct sf_procs {
108.     SF_ENTRY_C(struct, arti_info);
109.     SF_ENTRY_C(struct, nhrect);
110.     SF_ENTRY_C(struct, branch);
111.     SF_ENTRY_C(struct, bubble);
112.     SF_ENTRY_C(struct, cemetery);
113.     SF_ENTRY_C(struct, context_info);
114.     SF_ENTRY_C(struct, nhcoord);
115.     SF_ENTRY_C(struct, damage);
116.     SF_ENTRY_C(struct, dest_area);
117.     SF_ENTRY_C(struct, dgn_topology);
118.     SF_ENTRY_C(struct, dungeon);
119.     SF_ENTRY_C(struct, d_level);
120.     SF_ENTRY_C(struct, ebones);
121.     SF_ENTRY_C(struct, edog);
122.     SF_ENTRY_C(struct, egd);
123.     SF_ENTRY_C(struct, emin);
124.     SF_ENTRY_C(struct, engr);
125.     SF_ENTRY_C(struct, epri);
126.     SF_ENTRY_C(struct, eshk);
127.     SF_ENTRY_C(struct, fe);
128.     SF_ENTRY_C(struct, flag);
129.     SF_ENTRY_C(struct, fruit);
130.     SF_ENTRY_C(struct, gamelog_line);
131.     SF_ENTRY_C(struct, kinfo);
132.     SF_ENTRY_C(struct, levelflags);
133.     SF_ENTRY_C(struct, ls_t);
134.     SF_ENTRY_C(struct, linfo);
135.     SF_ENTRY_C(struct, mapseen_feat);
136.     SF_ENTRY_C(struct, mapseen_flags);
137.     SF_ENTRY_C(struct, mapseen_rooms);
138.     SF_ENTRY_C(struct, mkroom);
139.     SF_ENTRY_C(struct, monst);
140.     SF_ENTRY_C(struct, mvitals);
141.     SF_ENTRY_C(struct, obj);
142.     SF_ENTRY_C(struct, objclass);
143.     SF_ENTRY_C(struct, q_score);
144.     SF_ENTRY_C(struct, rm);
145.     SF_ENTRY_C(struct, spell);
146.     SF_ENTRY_C(struct, stairway);
147.     SF_ENTRY_C(struct, s_level);
148.     SF_ENTRY_C(struct, trap);
149.     SF_ENTRY_C(struct, version_info);
150.     SF_ENTRY_C(struct, you);
151.     SF_ENTRY_C(union, any);
152. 
153.     SF_ENTRY(aligntyp);
154.     SF_ENTRY(boolean);
155.     SF_ENTRY(coordxy);
156.     SF_ENTRY(genericptr);
157.     SF_ENTRY(int);
158.     SF_ENTRY(int16);
159.     SF_ENTRY(int32);
160.     SF_ENTRY(int64);
161.     SF_ENTRY(long);
162.     SF_ENTRY(schar);
163.     SF_ENTRY(short);
164.     SF_ENTRY(size_t);
165.     SF_ENTRY(time_t);
166.     SF_ENTRY(uchar);
167.     SF_ENTRY(uint16);
168.     SF_ENTRY(uint32);
169.     SF_ENTRY(uint64);
170.     SF_ENTRY(ulong);
171.     SF_ENTRY(unsigned);
172.     SF_ENTRY(ushort);
173.     SF_ENTRY(xint16);
174.     SF_ENTRY(xint8);
175.     SF_ENTRY_X(char, char);
176.     SF_ENTRY_X(uint8_t, bitfield);
177. };
178. 
179. #undef SF_ENTRY
180. #undef SF_ENTRY_C
181. #undef SF_ENTRY_X
182. 
183. struct sf_structlevel_procs {
184.     const char *ext;
185.     struct sf_procs fn;    /* called for structlevel (historical) */
186. };
187. struct sf_fieldlevel_procs {
188.     const char *ext;
189.     struct sf_procs fn_x; /* called for fieldlevel */
190. };
191. extern struct sf_structlevel_procs sfoprocs[NUM_SAVEFORMATS], sfiprocs[NUM_SAVEFORMATS];
192. extern void sf_setprocs(int, struct sf_structlevel_procs *, struct sf_structlevel_procs *);
193. extern void sf_setflprocs(int, struct sf_fieldlevel_procs *, struct sf_fieldlevel_procs *);
194. extern struct sf_structlevel_procs sfoprocs[NUM_SAVEFORMATS], sfiprocs[NUM_SAVEFORMATS];
195. extern struct sf_fieldlevel_procs sfoflprocs[NUM_SAVEFORMATS], sfiflprocs[NUM_SAVEFORMATS];
196. extern struct sf_structlevel_procs historical_sfo_procs;
197. extern struct sf_structlevel_procs historical_sfi_procs;
198. extern struct sf_fieldlevel_procs exportascii_sfo_procs;
199. extern struct sf_fieldlevel_procs exportascii_sfi_procs;
200. 
201. #endif /* SFPROCS_H */
202.