equal
deleted
inserted
replaced
|
1 /* |
|
2 * Public header file for the hedgewars frontent networking library. |
|
3 * |
|
4 * This is the only header you should need to include from frontend code. |
|
5 */ |
|
6 |
|
7 #ifndef FRONTLIB_H_ |
|
8 #define FRONTLIB_H_ |
|
9 |
|
10 #define FRONTLIB_SDL_ALREADY_INITIALIZED 1 |
|
11 |
|
12 /** |
|
13 * Call this function before anything else in this library. |
|
14 * |
|
15 * If the calling program uses SDL, it needs to call SDL_Init before initializing |
|
16 * this library and then pass FRONTLIB_SDL_ALREADY_INITIALIZED as flag to this function. |
|
17 * |
|
18 * Otherwise, pass 0 to let this library handle SDL_Init an SDL_Quit itself. |
|
19 * |
|
20 * Returns 0 on success, -1 on error. |
|
21 */ |
|
22 int flib_init(int flags); |
|
23 |
|
24 /** |
|
25 * Free resources associated with the library. Call this function once |
|
26 * the library is no longer needed. You can re-initialize the library by calling |
|
27 * flib_init again. |
|
28 */ |
|
29 void flib_quit(); |
|
30 |
|
31 /** |
|
32 * Start listening for a connection from the engine. |
|
33 * Returns the port we are listening on, which needs to be passed to the engine. |
|
34 */ |
|
35 int flib_ipc_listen(); |
|
36 |
|
37 #endif /* FRONTLIB_H_ */ |