added void functions
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
|
||||
#define SHIM_DEBUG
|
||||
#undef SHIM_DEBUG
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
typedef void(*stub_callback_t)(const char *name, void *ret_ptr, const char *fmt, ...);
|
||||
@@ -42,9 +42,9 @@ void stub_graphics_set_callback(stub_callback_t cb) {
|
||||
#define DECLCB(ret_type, name, fn_args, fmt, ...) \
|
||||
ret_type name fn_args { \
|
||||
void *args[] = { __VA_ARGS__ }; \
|
||||
ret_type ret; \
|
||||
ret_type ret = (ret_type) 0; \
|
||||
debugf("SHIM GRAPHICS: " #name "\n"); \
|
||||
if (!shim_graphics_callback) return; \
|
||||
if (!shim_graphics_callback) return ret; \
|
||||
shim_graphics_callback(#name, (void *)&ret, fmt, args); \
|
||||
return ret; \
|
||||
}
|
||||
@@ -61,9 +61,9 @@ void name fn_args { \
|
||||
#define P2V
|
||||
#define DECLCB(ret_type, name, fn_args, fmt, ...) \
|
||||
ret_type name fn_args { \
|
||||
ret_type ret; \
|
||||
ret_type ret = (ret_type) 0; \
|
||||
debugf("SHIM GRAPHICS: " #name "\n"); \
|
||||
if (!shim_graphics_callback) return; \
|
||||
if (!shim_graphics_callback) return ret; \
|
||||
shim_graphics_callback(#name, (void *)&ret, fmt, __VA_ARGS__); \
|
||||
return ret; \
|
||||
}
|
||||
@@ -104,60 +104,68 @@ name args { \
|
||||
#define DECL(name, args) \
|
||||
void name args;
|
||||
|
||||
VSTUB(shim_init_nhwindows,(int *argcp, char **argv))
|
||||
VSTUB(shim_player_selection,(void))
|
||||
VSTUB(shim_askname,(void))
|
||||
VSTUB(shim_get_nh_event,(void))
|
||||
VSTUB(shim_exit_nhwindows,(const char *a))
|
||||
VSTUB(shim_suspend_nhwindows,(const char *a))
|
||||
VSTUB(shim_resume_nhwindows,(void))
|
||||
VDECLCB(shim_init_nhwindows,(int *argcp, char **argv), "vpp", P2V argcp, P2V argv)
|
||||
VDECLCB(shim_player_selection,(void), "v")
|
||||
VDECLCB(shim_askname,(void), "v")
|
||||
VDECLCB(shim_get_nh_event,(void), "v")
|
||||
VDECLCB(shim_exit_nhwindows,(const char *str), "vs", P2V str)
|
||||
VDECLCB(shim_suspend_nhwindows,(const char *str), "vs", P2V str)
|
||||
VDECLCB(shim_resume_nhwindows,(void), "v")
|
||||
// DECLCB(winid, shim_create_nhwindow, (int type), "ii", A2P type)
|
||||
winid STUB(shim_create_nhwindow, WINSTUB_MAP, (int a))
|
||||
VSTUB(shim_clear_nhwindow,(winid a))
|
||||
VSTUB(shim_display_nhwindow,(winid a, BOOLEAN_P b))
|
||||
VSTUB(shim_destroy_nhwindow,(winid a))
|
||||
VDECLCB(shim_clear_nhwindow,(winid window), "vi", A2P window)
|
||||
VDECLCB(shim_display_nhwindow,(winid window, BOOLEAN_P blocking), "vii", A2P window, A2P blocking)
|
||||
VDECLCB(shim_destroy_nhwindow,(winid window), "vi", A2P window)
|
||||
VDECLCB(shim_curs,(winid a, int x, int y), "viii", A2P a, A2P x, A2P y)
|
||||
VDECLCB(shim_putstr,(winid w, int attr, const char *str), "viis", A2P w, A2P attr, P2V str)
|
||||
VSTUB(shim_display_file,(const char *a, BOOLEAN_P b))
|
||||
VSTUB(shim_start_menu,(winid w, unsigned long mbehavior))
|
||||
VSTUB(shim_add_menu,(winid a, int b, const ANY_P *c, CHAR_P d, CHAR_P e, int f, const char *h, unsigned int k))
|
||||
VSTUB(shim_end_menu,(winid a, const char *b))
|
||||
VDECLCB(shim_display_file,(const char *name, BOOLEAN_P complain), "vsi", P2V name, A2P complain)
|
||||
VDECLCB(shim_start_menu,(winid window, unsigned long mbehavior), "vii", A2P window, A2P mbehavior)
|
||||
VDECLCB(shim_add_menu,
|
||||
(winid window, int glyph, const ANY_P *identifier, CHAR_P ch, CHAR_P gch, int attr, const char *str, unsigned int itemflags),
|
||||
"viipiiisi",
|
||||
A2P window, A2P glyph, P2V identifier, A2P ch, A2P gch, A2P attr, P2V str, A2P itemflags)
|
||||
VDECLCB(shim_end_menu,(winid window, const char *prompt), "vis", A2P window, P2V prompt)
|
||||
int STUB(shim_select_menu,0,(winid a, int b, MENU_ITEM_P **c))
|
||||
char STUB(shim_message_menu,'y',(CHAR_P a, int b, const char *c))
|
||||
VSTUB(shim_update_inventory,(void))
|
||||
VSTUB(shim_mark_synch,(void))
|
||||
VSTUB(shim_wait_synch,(void))
|
||||
VSTUB(shim_cliparound,(int a, int b))
|
||||
VSTUB(shim_update_positionbar,(char *a))
|
||||
VDECLCB(shim_update_inventory,(void), "v")
|
||||
VDECLCB(shim_mark_synch,(void), "v")
|
||||
VDECLCB(shim_wait_synch,(void), "v")
|
||||
VDECLCB(shim_cliparound,(int x, int y), "vii", A2P x, A2P y)
|
||||
VDECLCB(shim_update_positionbar,(char *posbar), "vp", P2V posbar)
|
||||
VDECLCB(shim_print_glyph,(winid w, int x, int y, int glyph, int bkglyph), "viiiii", A2P w, A2P x, A2P y, A2P glyph, A2P bkglyph)
|
||||
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
|
||||
VSTUB(shim_raw_print_bold,(const char *a))
|
||||
VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str)
|
||||
int STUB(shim_nhgetch,0,(void))
|
||||
int STUB(shim_nh_poskey,0,(int *a, int *b, int *c))
|
||||
VSTUB(shim_nhbell,(void))
|
||||
VDECLCB(shim_nhbell,(void), "v")
|
||||
int STUB(shim_doprev_message,0,(void))
|
||||
char STUB(shim_yn_function,'y',(const char *a, const char *b, CHAR_P c))
|
||||
VSTUB(shim_getlin,(const char *a, char *b))
|
||||
VDECLCB(shim_getlin,(const char *query, char *bufp), "vsp", P2V query, P2V bufp)
|
||||
int STUB(shim_get_ext_cmd,0,(void))
|
||||
VSTUB(shim_number_pad,(int a))
|
||||
VSTUB(shim_delay_output,(void))
|
||||
VSTUB(shim_change_color,(int a, long b, int c))
|
||||
VSTUB(shim_change_background,(int a))
|
||||
VDECLCB(shim_number_pad,(int state), "vi", A2P state)
|
||||
VDECLCB(shim_delay_output,(void), "v")
|
||||
VDECLCB(shim_change_color,(int color, long rgb, int reverse), "viii", A2P color, A2P rgb, A2P reverse)
|
||||
VDECLCB(shim_change_background,(int white_or_black), "vi", A2P white_or_black)
|
||||
short STUB(set_shim_font_name,0,(winid a, char *b))
|
||||
VSTUB(shim_get_color_string,(void))
|
||||
char *STUB(shim_get_color_string,"",(void))
|
||||
|
||||
/* other defs that really should go away (they're tty specific) */
|
||||
VSTUB(shim_start_screen, (void))
|
||||
VSTUB(shim_end_screen, (void))
|
||||
VSTUB(shim_preference_update, (const char *a))
|
||||
VDECLCB(shim_start_screen, (void), "v")
|
||||
VDECLCB(shim_end_screen, (void), "v")
|
||||
VDECLCB(shim_preference_update, (const char *pref), "vp", P2V pref)
|
||||
char *STUB(shim_getmsghistory, (char *)"", (BOOLEAN_P a))
|
||||
VSTUB(shim_putmsghistory, (const char *a, BOOLEAN_P b))
|
||||
VSTUB(shim_status_init, (void))
|
||||
VSTUB(shim_status_enablefield, (int a, const char *b, const char *c, BOOLEAN_P d))
|
||||
VSTUB(shim_status_update, (int a, genericptr_t b, int c, int d, int e, unsigned long *f))
|
||||
VDECLCB(shim_putmsghistory, (const char *msg, BOOLEAN_P restoring_msghist), "vsi", P2V msg, A2P restoring_msghist)
|
||||
VDECLCB(shim_status_init, (void), "v")
|
||||
VDECLCB(shim_status_enablefield,
|
||||
(int fieldidx, const char *nm, const char *fmt, BOOLEAN_P enable),
|
||||
"vippi",
|
||||
A2P fieldidx, P2V nm, P2V fmt, A2P enable)
|
||||
VDECLCB(shim_status_update,
|
||||
(int fldidx, genericptr_t ptr, int chg, int percent, int color, unsigned long *colormasks),
|
||||
"vipiiip",
|
||||
A2P fldidx, P2V ptr, A2P chg, A2P percent, A2P color, P2V colormasks)
|
||||
|
||||
|
||||
/* old: | WC_TILED_MAP */
|
||||
/* Interface definition, for windows.c */
|
||||
/* Interface definition used in windows.c */
|
||||
struct window_procs shim_procs = {
|
||||
"shim",
|
||||
(0
|
||||
|
||||
Reference in New Issue
Block a user