author | Medo <smaxein@googlemail.com> |
Thu, 07 Jun 2012 02:45:18 +0200 | |
changeset 7175 | 038e3415100a |
parent 7173 | 7c2eb284f9f1 |
child 7177 | bf6cf4dd847a |
permissions | -rw-r--r-- |
7173
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
1 |
#ifndef IPC_H_ |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
2 |
#define IPC_H_ |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
3 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
4 |
#include "buffer.h" |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
5 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
6 |
#include <stddef.h> |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
7 |
#include <stdint.h> |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
8 |
#include <stdbool.h> |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
9 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
10 |
struct _flib_ipc; |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
11 |
typedef struct _flib_ipc *flib_ipc; |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
12 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
13 |
typedef enum { |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
14 |
GAME_END_FINISHED, |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
15 |
GAME_END_INTERRUPTED, |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
16 |
GAME_END_HALTED |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
17 |
} flib_GameEndType; |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
18 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
19 |
flib_ipc flib_ipc_create(bool recordDemo, const char *localPlayerName); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
20 |
void flib_ipc_destroy(flib_ipc *ipcptr); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
21 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
22 |
void flib_ipc_onConnect(flib_ipc ipc, void (*callback)(void* context), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
23 |
void flib_ipc_onDisconnect(flib_ipc ipc, void (*callback)(void* context), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
24 |
void flib_ipc_onConfigQuery(flib_ipc ipc, void (*callback)(void* context), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
25 |
void flib_ipc_onEngineError(flib_ipc ipc, void (*callback)(void* context, const uint8_t *error), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
26 |
void flib_ipc_onGameEnd(flib_ipc ipc, void (*callback)(void* context, int gameEndType), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
27 |
void flib_ipc_onChat(flib_ipc ipc, void (*callback)(void* context, const uint8_t *messagestr, int teamchat), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
28 |
void flib_ipc_onEngineMessage(flib_ipc ipc, void (*callback)(void* context, const uint8_t *message, int len), void* context); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
29 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
30 |
int flib_ipc_send_raw(flib_ipc ipc, void *data, size_t len); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
31 |
int flib_ipc_send_message(flib_ipc ipc, void *data, size_t len); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
32 |
int flib_ipc_send_messagestr(flib_ipc ipc, char *data); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
33 |
|
7175
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
34 |
// Configuration |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
35 |
int flib_ipc_send_seed(flib_ipc ipc, const char *seed); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
36 |
int flib_ipc_send_script(flib_ipc ipc, const char *scriptpath); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
37 |
int flib_ipc_send_map_regular(flib_ipc ipc, const char *theme, int templateFilter); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
38 |
int flib_ipc_send_map_maze(flib_ipc ipc, const char *theme, int mazeType); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
39 |
int flib_ipc_send_map_drawn(flib_ipc ipc, const char *theme, void *drawnMapData, size_t drawnMapDataLen); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
40 |
int flib_ipc_send_map_named(flib_ipc ipc, const char *mappath); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
41 |
int flib_ipc_send_gamemods(flib_ipc ipc, uint32_t modflags); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
42 |
int flib_ipc_send_gamesetting(flib_ipc ipc, const char *settingname, int modflags); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
43 |
int flib_ipc_send_weapon_loadout(flib_ipc ipc, const char *weapsettings); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
44 |
int flib_ipc_send_weapon_delay(flib_ipc ipc, const char *weapsettings); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
45 |
int flib_ipc_send_weapon_cratechance(flib_ipc ipc, const char *weapsettings); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
46 |
int flib_ipc_send_weapon_crateammo(flib_ipc ipc, const char *weapsettings); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
47 |
|
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
48 |
int flib_ipc_send_conf_end(flib_ipc ipc); |
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
49 |
|
038e3415100a
Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents:
7173
diff
changeset
|
50 |
|
7173
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
51 |
uint16_t flib_ipc_port(flib_ipc ipc); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
52 |
flib_constbuffer flib_ipc_getdemo(flib_ipc ipc); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
53 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
54 |
void flib_ipc_tick(flib_ipc ipc); |
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
55 |
|
7c2eb284f9f1
Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
56 |
#endif /* IPC_H_ */ |