| 1 |
#ifndef GARGLK_GI_DISPA_H |
| 2 |
#define GARGLK_GI_DISPA_H |
| 3 |
|
| 4 |
#ifdef __cplusplus |
| 5 |
extern "C" { |
| 6 |
#endif |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#define gidisp_Class_Window (0) |
| 23 |
#define gidisp_Class_Stream (1) |
| 24 |
#define gidisp_Class_Fileref (2) |
| 25 |
#define gidisp_Class_Schannel (3) |
| 26 |
|
| 27 |
typedef union gluniversal_union { |
| 28 |
glui32 uint; |
| 29 |
glsi32 sint; |
| 30 |
void *opaqueref; |
| 31 |
unsigned char uch; |
| 32 |
signed char sch; |
| 33 |
char ch; |
| 34 |
char *charstr; |
| 35 |
glui32 *unicharstr; |
| 36 |
void *array; |
| 37 |
glui32 ptrflag; |
| 38 |
} gluniversal_t; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
typedef struct gidispatch_function_struct { |
| 46 |
glui32 id; |
| 47 |
void *fnptr; |
| 48 |
char *name; |
| 49 |
} gidispatch_function_t; |
| 50 |
|
| 51 |
typedef struct gidispatch_intconst_struct { |
| 52 |
char *name; |
| 53 |
glui32 val; |
| 54 |
} gidispatch_intconst_t; |
| 55 |
|
| 56 |
typedef union glk_objrock_union { |
| 57 |
glui32 num; |
| 58 |
void *ptr; |
| 59 |
} gidispatch_rock_t; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
extern void gidispatch_set_object_registry( |
| 66 |
gidispatch_rock_t (*regi)(void *obj, glui32 objclass), |
| 67 |
void (*unregi)(void *obj, glui32 objclass, gidispatch_rock_t objrock)); |
| 68 |
extern gidispatch_rock_t gidispatch_get_objrock(void *obj, glui32 objclass); |
| 69 |
extern void gidispatch_set_retained_registry( |
| 70 |
gidispatch_rock_t (*regi)(void *array, glui32 len, char *typecode), |
| 71 |
void (*unregi)(void *array, glui32 len, char *typecode, |
| 72 |
gidispatch_rock_t objrock)); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
#ifndef GARGLK |
| 79 |
#define GIDISPATCH_AUTORESTORE_REGISTRY |
| 80 |
#endif |
| 81 |
extern void gidispatch_set_autorestore_registry( |
| 82 |
long (*locatearr)(void *array, glui32 len, char *typecode, |
| 83 |
gidispatch_rock_t objrock, int *elemsizeref), |
| 84 |
gidispatch_rock_t (*restorearr)(long bufkey, glui32 len, |
| 85 |
char *typecode, void **arrayref)); |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
extern void gidispatch_call(glui32 funcnum, glui32 numargs, |
| 93 |
gluniversal_t *arglist); |
| 94 |
extern char *gidispatch_prototype(glui32 funcnum); |
| 95 |
extern glui32 gidispatch_count_classes(void); |
| 96 |
extern gidispatch_intconst_t *gidispatch_get_class(glui32 index); |
| 97 |
extern glui32 gidispatch_count_intconst(void); |
| 98 |
extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index); |
| 99 |
extern glui32 gidispatch_count_functions(void); |
| 100 |
extern gidispatch_function_t *gidispatch_get_function(glui32 index); |
| 101 |
extern gidispatch_function_t *gidispatch_get_function_by_id(glui32 id); |
| 102 |
|
| 103 |
#define GI_DISPA_GAME_ID_AVAILABLE |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
#ifdef GI_DISPA_GAME_ID_AVAILABLE |
| 113 |
extern void gidispatch_set_game_id_hook(char *(*hook)(void)); |
| 114 |
extern char *gidispatch_get_game_id(void); |
| 115 |
#endif |
| 116 |
|
| 117 |
#ifdef __cplusplus |
| 118 |
} |
| 119 |
#endif |
| 120 |
|
| 121 |
#endif |