project_files/frontlib/ipc/ipcprotocol.h
changeset 7177 bf6cf4dd847a
child 7179 f84805e6df03
equal deleted inserted replaced
7175:038e3415100a 7177:bf6cf4dd847a
       
     1 #ifndef IPCPROTOCOL_H_
       
     2 #define IPCPROTOCOL_H_
       
     3 
       
     4 #include "../buffer.h"
       
     5 #include "../model/map.h"
       
     6 
       
     7 #include <stdbool.h>
       
     8 
       
     9 /**
       
    10  * Create a message in the IPC protocol format and add it to
       
    11  * the vector. Use a format string and extra parameters as with printf.
       
    12  *
       
    13  * Returns nonzero if something goes wrong. In that case the buffer
       
    14  * contents are unaffected.
       
    15  */
       
    16 int flib_ipc_append_message(flib_vector vec, const char *fmt, ...);
       
    17 
       
    18 /**
       
    19  * Append IPC messages to the buffer that configure the engine for
       
    20  * this map.
       
    21  *
       
    22  * Unfortunately the engine needs a slightly different configuration
       
    23  * for generating a map preview.
       
    24  *
       
    25  * Returns nonzero if something goes wrong. In that case the buffer
       
    26  * contents are unaffected.
       
    27  */
       
    28 int flib_ipc_append_mapconf(flib_vector vec, flib_map *map, bool mappreview);
       
    29 
       
    30 /**
       
    31  * Append a seed message to the buffer.
       
    32  *
       
    33  * Returns nonzero if something goes wrong. In that case the buffer
       
    34  * contents are unaffected.
       
    35  */
       
    36 int flib_ipc_append_seed(flib_vector vec, const char *seed);
       
    37 
       
    38 #endif /* IPCPROTOCOL_H_ */