Source:SLASH'EM 0.0.7E7F2/proxycom.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to proxycom.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/proxycom.h#line123]], for example.

The latest source code for vanilla NetHack is at Source code.


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.    /* $Id: proxycom.h,v 1.17 2004/04/19 06:56:41 j_ali Exp $ */
2.    /* Copyright (c) Slash'EM Development Team 2002-2004 */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef PROXYCOM_H
6.    #define PROXYCOM_H
7.    
8.    /* The NhExt standard to which we conform */
9.    
10.   #define EXT_STANDARD_MAJOR	1
11.   #define EXT_STANDARD_MINOR	0
12.   #define EXT_STANDARD_MICRO	2	/* Not used in the code */
13.   
14.   #define EXT_IM_STATUS		0x0001
15.   #define EXT_IM_DISPLAY_LAYERS	0x0002
16.   
17.   #define EXT_PARAM_INT		0x4001
18.   #define EXT_PARAM_LONG		0x4002
19.   #define EXT_PARAM_STRING	0x4003
20.   #define EXT_PARAM_BYTES		0x4004
21.   #define EXT_PARAM_BOOLEAN	0x4005
22.   #define EXT_PARAM_CHAR		0x4006
23.   #define EXT_PARAM_XDRF		0x4007
24.   
25.   #define EXT_PARAM_PTR		0x8000
26.   
27.   #define EXT_INT(i)		EXT_PARAM_INT, i
28.   #define EXT_LONG(l)		EXT_PARAM_LONG, l
29.   #define EXT_STRING(s)		EXT_PARAM_STRING, (s) ? (s) : ""
30.   #define EXT_BYTES(buf,nb)	EXT_PARAM_BYTES, buf, nb
31.   #define EXT_BOOLEAN(b)		EXT_PARAM_BOOLEAN, b
32.   #define EXT_CHAR(c)		EXT_PARAM_CHAR, c
33.   #define EXT_XDRF(func,data)	EXT_PARAM_XDRF, func, data
34.   
35.   #define EXT_INT_P(i)		EXT_PARAM_PTR | EXT_PARAM_INT, &(i)
36.   #define EXT_LONG_P(l)		EXT_PARAM_PTR | EXT_PARAM_LONG, &(l)
37.   #define EXT_STRING_P(s)		EXT_PARAM_PTR | EXT_PARAM_STRING, &(s)
38.   #define EXT_BYTES_P(buf,nb)	EXT_PARAM_PTR | EXT_PARAM_BYTES, &(buf), &(nb)
39.   #define EXT_BOOLEAN_P(b)	EXT_PARAM_PTR | EXT_PARAM_BOOLEAN, &(b)
40.   #define EXT_CHAR_P(c)		EXT_PARAM_PTR | EXT_PARAM_CHAR, &(c)
41.   
42.   #define EXT_SPECIAL_ERROR	0
43.   
44.   #define EXT_ERROR_UNSUPPORTED		1
45.   #define EXT_ERROR_UNAVAILABLE		2
46.   #define EXT_ERROR_INVALIDENCODING	3
47.   #define EXT_ERROR_INVALIDPARAMS		4
48.   #define EXT_ERROR_RESOURCEFAILURE	5
49.   
50.   #define EXT_ERROR_GENERIC		0x100
51.   
52.   #define EXT_ERROR_INTERNAL		0x101
53.   #define EXT_ERROR_COMMS			0x102
54.   #define EXT_ERROR_NOTSUPPORTED		0x103
55.   #define EXT_ERROR_PROTOCOL		0x104
56.   
57.   #ifdef NHXDR_H
58.   struct nhext_svc {
59.       unsigned short id;
60.       void FDECL((*handler), (unsigned short, NhExtXdr *, NhExtXdr *));
61.   };
62.   
63.   struct nhext_line {
64.       char *type;
65.       int n;
66.       char **tags, **values;
67.   };
68.   
69.   typedef void FDECL((*nhext_errhandler), (int, const char *));
70.   
71.   E int FDECL(nhext_init, (NhExtIO *, NhExtIO *, struct nhext_svc *));
72.   E int FDECL(nhext_set_protocol, (int));
73.   E int NDECL(nhext_async_mode);
74.   E void NDECL(nhext_end);
75.   E int FDECL(nhext_subprotocol0_write_line, (struct nhext_line *));
76.   E void FDECL(nhext_subprotocol0_free_line, (struct nhext_line *));
77.   E struct nhext_line *NDECL(nhext_subprotocol0_read_line);
78.   E char *FDECL(nhext_subprotocol0_get_failed_packet, (int *));
79.   E nhext_errhandler FDECL(nhext_set_errhandler, (nhext_errhandler));
80.   E int VDECL(nhext_rpc_params, (NhExtXdr *xdrs, int, ...));
81.   E int VDECL(nhext_rpc, (unsigned short, ...));
82.   E int FDECL(nhext_svc, (struct nhext_svc *));
83.   E void FDECL(nhext_set_async_masks, (int, unsigned long *));
84.   E void FDECL(nhext_set_unsupported, (int));
85.   E unsigned short NDECL(nhext_rpc_get_next_serial);
86.   E unsigned short NDECL(nhext_svc_get_serial);
87.   E void FDECL(nhext_send_error, (unsigned short, unsigned char));
88.   #endif	/* NHXDR_H */
89.   
90.   #define EXT_FID_INIT			0x01
91.   #define EXT_FID_INIT_NHWINDOWS		0x02
92.   #define EXT_FID_PLAYER_SELECTION	0x03
93.   #define EXT_FID_ASKNAME			0x04
94.   #define EXT_FID_GET_NH_EVENT		0x05
95.   #define EXT_FID_EXIT_NHWINDOWS		0x06
96.   #define EXT_FID_SUSPEND_NHWINDOWS	0x07
97.   #define EXT_FID_RESUME_NHWINDOWS	0x08
98.   #define EXT_FID_CREATE_NHWINDOW		0x09
99.   #define EXT_FID_CLEAR_NHWINDOW		0x0A
100.  #define EXT_FID_DISPLAY_NHWINDOW	0x0B
101.  #define EXT_FID_DESTROY_NHWINDOW	0x0C
102.  #define EXT_FID_CURS			0x0D
103.  #define EXT_FID_PUTSTR			0x0E
104.  #define EXT_FID_DISPLAY_FILE		0x0F
105.  #define EXT_FID_START_MENU		0x10
106.  #define EXT_FID_ADD_MENU		0x11
107.  #define EXT_FID_END_MENU		0x12
108.  #define EXT_FID_SELECT_MENU		0x13
109.  #define EXT_FID_MESSAGE_MENU		0x14
110.  #define EXT_FID_UPDATE_INVENTORY	0x15
111.  #define EXT_FID_MARK_SYNC		0x16
112.  #define EXT_FID_WAIT_SYNC		0x17
113.  #define EXT_FID_CLIPAROUND		0x18
114.  #define EXT_FID_UPDATE_POSITIONBAR	0x19
115.  #define EXT_FID_PRINT_GLYPH		0x1A
116.  #define EXT_FID_RAW_PRINT		0x1B
117.  #define EXT_FID_RAW_PRINT_BOLD		0x1C
118.  #define EXT_FID_NHGETCH			0x1D
119.  #define EXT_FID_NH_POSKEY		0x1E
120.  #define EXT_FID_NHBELL			0x1F
121.  #define EXT_FID_DOPREV_MESSAGE		0x20
122.  #define EXT_FID_YN_FUNCTION		0x21
123.  #define EXT_FID_GETLIN			0x22
124.  #define EXT_FID_GET_EXT_CMD		0x23
125.  #define EXT_FID_NUMBER_PAD		0x24
126.  #define EXT_FID_DELAY_OUTPUT		0x25
127.  #define EXT_FID_CHANGE_COLOR		0x26
128.  #define EXT_FID_CHANGE_BACKGROUND	0x27
129.  #define EXT_FID_SET_FONT_NAME		0x28
130.  #define EXT_FID_GET_COLOR_STRING	0x29
131.  #define EXT_FID_START_SCREEN		0x2A
132.  #define EXT_FID_END_SCREEN		0x2B
133.  #define EXT_FID_OUTRIP			0x2C
134.  #define EXT_FID_PREFERENCE_UPDATE	0x2D
135.  #define EXT_FID_STATUS			0x2E
136.  #define EXT_FID_PRINT_GLYPH_LAYERED	0x2F
137.  #define EXT_FID_SEND_CONFIG_FILE	0x30
138.  
139.  #ifdef NHXDR_H
140.  struct proxy_init_nhwindow_req {
141.      int argc;
142.      char **argv;
143.  };
144.  
145.  struct proxy_init_nhwindow_res {
146.      nhext_xdr_bool_t inited;
147.      int argc;
148.      char **argv;
149.      int capc;
150.      char **capv;
151.  };
152.  
153.  struct proxy_mi {
154.      int item;			/* identifier */
155.      long count;			/* count */
156.  };
157.  
158.  struct proxy_select_menu_res {
159.      int retval;
160.      int n;
161.      struct proxy_mi *selected;
162.  };
163.  
164.  struct proxy_status_req {
165.      int reconfig;
166.      int nv;
167.      const char **values;
168.  };
169.  
170.  struct proxy_glyph_row {
171.      int start;
172.      int ng;
173.      int *glyphs;
174.  };
175.  
176.  struct proxy_glyph_layer {
177.      int start;
178.      int nr;
179.      struct proxy_glyph_row *rows;
180.  };
181.  
182.  struct proxy_print_glyph_layered_req {
183.      int window;
184.      int nl;
185.      struct proxy_glyph_layer *layers;
186.  };
187.  
188.  E nhext_xdr_bool_t FDECL(proxy_xdr_init_nhwindow_req,
189.  		(NhExtXdr *, struct proxy_init_nhwindow_req *));
190.  E nhext_xdr_bool_t FDECL(proxy_xdr_init_nhwindow_res,
191.  		(NhExtXdr *, struct proxy_init_nhwindow_res *));
192.  E nhext_xdr_bool_t FDECL(proxy_xdr_proxy_mi, (NhExtXdr *, struct proxy_mi *));
193.  E nhext_xdr_bool_t FDECL(proxy_xdr_select_menu_res,
194.  		(NhExtXdr *, struct proxy_select_menu_res *));
195.  E nhext_xdr_bool_t FDECL(proxy_xdr_status_req,
196.  		(NhExtXdr *, struct proxy_status_req *));
197.  E nhext_xdr_bool_t FDECL(proxy_xdr_print_glyph_layered_req,
198.  		(NhExtXdr *, struct proxy_print_glyph_layered_req *));
199.  #endif	/* NHXDR_H */
200.  
201.  #define EXT_CID_DISPLAY_INVENTORY	0x01
202.  #define EXT_CID_DLBH_FOPEN		0x02
203.  #define EXT_CID_DLBH_FGETS		0x03
204.  #define EXT_CID_DLBH_FREAD		0x04
205.  #define EXT_CID_DLBH_FWRITE		0x05
206.  #define EXT_CID_DLBH_FCLOSE		0x06
207.  #define EXT_CID_DLBH_FMD5SUM		0x07
208.  #define EXT_CID_FLUSH_SCREEN		0x08
209.  #define EXT_CID_DOREDRAW		0x09
210.  #define EXT_CID_INTERFACE_MODE		0x0A
211.  #define EXT_CID_PARSE_OPTIONS		0x0B
212.  #define EXT_CID_GET_OPTION		0x0C
213.  #define EXT_CID_GET_PLAYER_CHOICES	0x0D
214.  #define EXT_CID_GET_VALID_SELECTIONS	0x0E
215.  #define EXT_CID_QUIT_GAME		0x0F
216.  #define EXT_CID_DISPLAY_SCORE		0x10
217.  #define EXT_CID_DOSET			0x11
218.  #define EXT_CID_GET_EXTENDED_COMMANDS	0x12
219.  #define EXT_CID_MAP_MENU_CMD		0x13
220.  #define EXT_CID_GET_STANDARD_WINID	0x14
221.  #define EXT_CID_GET_TILESETS		0x15
222.  #define EXT_CID_GET_GLYPH_MAPPING	0x16
223.  #define EXT_CID_GET_EXTENSIONS		0x17
224.  #define EXT_CID_SET_OPTION_MOD_STATUS	0x18
225.  
226.  #ifdef NHXDR_H
227.  struct proxycb_dlbh_fmd5sum_res {
228.  	int retval;
229.  	const char *digest;
230.  };
231.  
232.  struct proxycb_get_player_choices_res_role {
233.  	const char *male;
234.  	const char *female;
235.  };
236.  
237.  struct proxycb_get_player_choices_res {
238.  	int n_aligns;
239.  	const char **aligns;
240.  	int n_genders;
241.  	const char **genders;
242.  	int n_races;
243.  	const char **races;
244.  	int n_roles;
245.  	struct proxycb_get_player_choices_res_role *roles;
246.  };
247.  
248.  struct proxycb_get_valid_selections_res {
249.  	int no_roles;
250.  	int no_races;
251.  	int no_aligns;
252.  	int no_genders;
253.  	int n_masks;
254.  	unsigned long *masks;
255.  };
256.  
257.  struct proxycb_get_extended_commands_res {
258.  	int n_commands;
259.  	const char **commands;
260.  };
261.  
262.  struct proxycb_get_tilesets_res_tileset {
263.  	const char *name;
264.  	const char *file;
265.  	const char *mapfile;
266.  	unsigned long flags;
267.  };
268.  
269.  struct proxycb_get_tilesets_res {
270.  	int n_tilesets;
271.  	struct proxycb_get_tilesets_res_tileset *tilesets;
272.  };
273.  
274.  #define RGB_SYM(rgb, sym)	((rgb) << 8 | (sym))
275.  #define RGBSYM_RGB(rgbsym)	((rgbsym) >> 8 & 0xFFFFFF)
276.  #define RGBSYM_SYM(rgbsym)	((rgbsym) & 0xFF)
277.  
278.  struct proxycb_get_glyph_mapping_res_symdef {
279.  	long rgbsym;
280.  	const char *description;
281.  };
282.  
283.  struct proxycb_get_glyph_mapping_res_submapping {
284.  	struct proxycb_get_glyph_mapping_res_symdef symdef;
285.  	int n_glyphs;
286.  	struct proxycb_get_glyph_mapping_res_symdef *glyphs;
287.  };
288.  
289.  struct proxycb_get_glyph_mapping_res_mapping {
290.  	const char *flags;
291.  	int base_mapping;
292.  	int alt_glyph;
293.  	struct proxycb_get_glyph_mapping_res_symdef symdef;
294.  	int n_submappings;
295.  	struct proxycb_get_glyph_mapping_res_submapping *submappings;
296.  };
297.  
298.  struct proxycb_get_glyph_mapping_res {
299.  	int no_glyph;
300.  	long transparent;
301.  	int n_mappings;
302.  	struct proxycb_get_glyph_mapping_res_mapping *mappings;
303.  };
304.  
305.  struct proxycb_get_extensions_res_extension {
306.  	const char *name;
307.  	const char *version;
308.  	int no_procedures;
309.  };
310.  
311.  struct proxycb_get_extensions_res {
312.  	int n_extensions;
313.  	struct proxycb_get_extensions_res_extension *extensions;
314.  };
315.  
316.  /* This structure is used for both the sub-protocol 2 init request and reply */
317.  struct proxycb_subprot2_init {
318.  	int n_masks;
319.  	unsigned long *masks;
320.  };
321.  
322.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_player_choices_res_role,
323.  		(NhExtXdr *, struct proxycb_get_player_choices_res_role *));
324.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_player_choices_res,
325.  		(NhExtXdr *, struct proxycb_get_player_choices_res *));
326.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_valid_selections_res,
327.  		(NhExtXdr *, struct proxycb_get_valid_selections_res *));
328.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_extended_commands_res,
329.  		(NhExtXdr *, struct proxycb_get_extended_commands_res *));
330.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_tilesets_res_tileset,
331.  		(NhExtXdr *, struct proxycb_get_tilesets_res_tileset *));
332.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_tilesets_res,
333.  		(NhExtXdr *, struct proxycb_get_tilesets_res *));
334.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_glyph_mapping_res_symdef,
335.  		(NhExtXdr *, struct proxycb_get_glyph_mapping_res_symdef *));
336.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_glyph_mapping_res_submapping,
337.  		(NhExtXdr *, struct proxycb_get_glyph_mapping_res_submapping *));
338.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_glyph_mapping_res_mapping,
339.  		(NhExtXdr *, struct proxycb_get_glyph_mapping_res_mapping *));
340.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_glyph_mapping_res,
341.  		(NhExtXdr *, struct proxycb_get_glyph_mapping_res *));
342.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_get_extensions_res,
343.  		(NhExtXdr *, struct proxycb_get_extensions_res *));
344.  extern nhext_xdr_bool_t FDECL(proxycb_xdr_subprot2_init,
345.  		(NhExtXdr *, struct proxycb_subprot2_init *));
346.  #endif  /* NHXDR_H */
347.  
348.  /* riputil.c */
349.  extern char * FDECL(get_killer_string, (int));
350.  /* getopt.c */
351.  extern char * FDECL(get_option, (const char *));
352.  /* glyphmap.c */
353.  extern void NDECL(set_glyph_mapping);
354.  extern struct proxycb_get_glyph_mapping_res * NDECL(get_glyph_mapping);
355.  extern void FDECL(free_glyph_mapping, (struct proxycb_get_glyph_mapping_res *));
356.  
357.  #endif /* PROXYCOM_H */