1 /*****************************************************************************
2  Freeciv - Copyright (C) 2005 - The Freeciv Project
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2, or (at your option)
6    any later version.
7 
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12 *****************************************************************************/
13 
14 #ifndef FC__SCRIPT_SERVER_H
15 #define FC__SCRIPT_SERVER_H
16 
17 /* utility */
18 #include "support.h"
19 
20 /* common/scriptcore */
21 #include "luascript_types.h"
22 
23 struct section_file;
24 struct connection;
25 
26 /* Callback invocation function. */
27 bool script_server_callback_invoke(const char *callback_name, int nargs,
28                                    enum api_types *parg_types, va_list args);
29 
30 void script_server_remove_exported_object(void *object);
31 
32 /* Script functions. */
33 bool script_server_init(void);
34 void script_server_free(void);
35 bool script_server_do_string(struct connection *caller, const char *str);
36 bool script_server_do_file(struct connection *caller, const char *filename);
37 bool script_server_load_file(const char *filename, char **buf);
38 
39 /* Script state i/o. */
40 void script_server_state_load(struct section_file *file);
41 void script_server_state_save(struct section_file *file);
42 
43 /* Signals. */
44 void script_server_signal_emit(const char *signal_name, int nargs, ...);
45 
46 /* Functions */
47 bool script_server_call(const char *func_name, int nargs, ...);
48 
49 #endif /* FC__SCRIPT_SERVER_H */
50 
51