diff --git a/src/bind_attrib.c b/src/bind_attrib.c deleted file mode 100644 index 424f7a82f..000000000 --- a/src/bind_attrib.c +++ /dev/null @@ -1,414 +0,0 @@ -/* vi: set ts=2: -+-------------------+ -| | Enno Rehling -| Eressea PBEM host | Christian Schlittchen -| (c) 1998 - 2010 | Katja Zedel -| | Henning Peters -+-------------------+ - -This program may not be used, modified or distributed -without prior permission by the authors of Eressea. -*/ - -#include -#include "bind_attrib.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* external libraries */ -#include - -#include -#include -#include - -static void init_ext(attrib * a) -{ - lua_State *L = (lua_State *) global.vm_state; - - lua_pushstring(L, "callbacks"); - lua_rawget(L, LUA_GLOBALSINDEX); - if (lua_istable(L, -1)) { - lua_pushstring(L, "attrib_init"); - lua_rawget(L, LUA_GLOBALSINDEX); - if (lua_isfunction(L, -1)) { - lua_rawgeti(L, LUA_REGISTRYINDEX, a->data.i); - if (lua_pcall(L, 1, 0, 0) != 0) { - const char *error = lua_tostring(L, -1); - log_error("attrib_init '%d': %s.\n", a->data.i, error); - } - } - } -} - -static void free_ext(attrib * a) -{ - lua_State *L = (lua_State *) global.vm_state; - if (a->data.i > 0) { - luaL_unref(L, LUA_REGISTRYINDEX, a->data.i); - } -} - -static int age_ext(attrib * a) -{ - return AT_AGE_KEEP; -} - -static void write_ext_i(lua_State * L, const char *name, bson_buffer * bb) -{ - int type = lua_type(L, -1); - switch (type) { - case LUA_TNUMBER: - { - double value = tolua_tonumber(L, -1, 0); - bson_append_double(bb, name, value); - } - break; - case LUA_TSTRING: - { - const char *value = tolua_tostring(L, -1, 0); - bson_append_string(bb, name, value); - } - break; - case LUA_TTABLE: - { - int n = luaL_getn(L, -1); - if (n) { - bson_buffer *arr = bson_append_start_array(bb, name); - int i; - for (i = 0; i != n; ++i) { - char num[12]; - bson_numstr(num, i); - lua_rawgeti(L, -1, i + 1); - write_ext_i(L, num, arr); - lua_pop(L, 1); - } - bson_append_finish_object(arr); - } else { - bson_buffer *sub = bson_append_start_object(bb, name); - lua_pushnil(L); /* first key */ - while (lua_next(L, -2) != 0) { - const char *key; - /* uses 'key' (at index -2) and 'value' (at index -1) */ - lua_pushvalue(L, -2); - key = lua_tolstring(L, -1, 0); - lua_pushvalue(L, -2); - if (key) { - write_ext_i(L, key, sub); - } - /* removes 'value'; keeps 'key' for next iteration */ - lua_pop(L, 3); - } - bson_append_finish_object(sub); - } - } - break; - case LUA_TUSERDATA: - { - tolua_Error tolua_err; - if (tolua_isusertype(L, -1, "unit", 0, &tolua_err)) { - unit *u = (unit *) tolua_tousertype(L, -1, 0); - bson_oid_t oid; - oid.ints[0] = TYP_UNIT; - oid.ints[1] = u->no; - bson_append_oid(bb, name, &oid); - } else if (tolua_isusertype(L, -1, "region", 0, &tolua_err)) { - region *r = (region *) tolua_tousertype(L, -1, 0); - bson_oid_t oid; - oid.ints[0] = TYP_REGION; - oid.ints[1] = r->uid; - bson_append_oid(bb, name, &oid); - } else if (tolua_isusertype(L, -1, "ship", 0, &tolua_err)) { - ship *sh = (ship *) tolua_tousertype(L, -1, 0); - bson_oid_t oid; - oid.ints[0] = TYP_SHIP; - oid.ints[1] = sh->no; - bson_append_oid(bb, name, &oid); - } else if (tolua_isusertype(L, -1, "building", 0, &tolua_err)) { - building *b = (building *) tolua_tousertype(L, -1, 0); - bson_oid_t oid; - oid.ints[0] = TYP_BUILDING; - oid.ints[1] = b->no; - bson_append_oid(bb, name, &oid); - } else { - log_error("unsuported type.\n"); - bson_append_null(bb, name); - } - } - break; - default: - bson_append_null(bb, name); - break; - } -} - -static void -write_ext(const attrib * a, const void *owner, struct storage *store) -{ - lua_State *L = (lua_State *) global.vm_state; - if (a->data.i > 0) { - int handle = a->data.i; - bson_buffer bb; - bson b; - - bson_buffer_init(&bb); - lua_rawgeti(L, LUA_REGISTRYINDEX, handle); - write_ext_i(L, "_data", &bb); - bson_from_buffer(&b, &bb); - store->w_int(store, bson_size(&b)); - store->w_bin(store, b.data, bson_size(&b)); - bson_destroy(&b); - } -} - -static int read_ext_i(lua_State * L, bson_iterator * it, bson_type type) -{ - switch (type) { - case bson_double: - { - lua_pushnumber(L, bson_iterator_double(it)); - } - break; - case bson_string: - { - lua_pushstring(L, bson_iterator_string(it)); - } - break; - case bson_array: - { - bson_iterator sub; - int err; - bson_iterator_subiterator(it, &sub); - lua_newtable(L); - if (bson_iterator_more(&sub)) { - bson_type ctype; - for (ctype = bson_iterator_next(&sub); bson_iterator_more(&sub); - ctype = bson_iterator_next(&sub)) { - int i = atoi(bson_iterator_key(&sub)); - err = read_ext_i(L, &sub, ctype); - if (err) { - lua_pop(L, 1); - return err; - } - lua_rawseti(L, -2, i + 1); - } - } - } - break; - case bson_object: - { - bson_iterator sub; - int err; - bson_iterator_subiterator(it, &sub); - lua_newtable(L); - if (bson_iterator_more(&sub)) { - bson_type ctype; - for (ctype = bson_iterator_next(&sub); bson_iterator_more(&sub); - ctype = bson_iterator_next(&sub)) { - lua_pushstring(L, bson_iterator_key(&sub)); - err = read_ext_i(L, &sub, ctype); - if (err) { - lua_pop(L, 1); - return err; - } - lua_rawset(L, -3); - } - } - } - break; - case bson_oid: - { - bson_oid_t *oid = bson_iterator_oid(it); - if (oid->ints[0] == TYP_UNIT) { - unit *u = findunit(oid->ints[1]); - if (u) - tolua_pushusertype(L, u, "unit"); - else - lua_pushnil(L); - } else if (oid->ints[0] == TYP_REGION) { - region *r = findregionbyid(oid->ints[1]); - if (r) - tolua_pushusertype(L, r, "region"); - else - lua_pushnil(L); - } else if (oid->ints[0] == TYP_SHIP) { - ship *sh = findship(oid->ints[1]); - if (sh) - tolua_pushusertype(L, sh, "ship"); - else - lua_pushnil(L); - } else if (oid->ints[0] == TYP_BUILDING) { - building *b = findbuilding(oid->ints[1]); - if (b) - tolua_pushusertype(L, b, "building"); - else - lua_pushnil(L); - } else { - log_error("unknown oid %d %d %d\n", oid->ints[0], oid->ints[1], oid->ints[2]); - lua_pushnil(L); - } - } - break; - case bson_null: - lua_pushnil(L); - break; - case bson_eoo: - return EFAULT; - default: - return EINVAL; - } - return 0; -} - -static int resolve_bson(variant data, void *address) -{ - lua_State *L = (lua_State *) global.vm_state; - bson b; - int err; - bson_iterator it; - attrib *a = (attrib *) address; - char *buffer = data.v; - - bson_init(&b, buffer, 1); - bson_iterator_init(&it, b.data); - err = read_ext_i(L, &it, bson_iterator_next(&it)); - a->data.i = luaL_ref(L, LUA_REGISTRYINDEX); - bson_destroy(&b); - return err ? AT_READ_FAIL : AT_READ_OK; -} - -static int read_ext(attrib * a, void *owner, struct storage *store) -{ - variant data; - int len = store->r_int(store); - data.v = bson_malloc(len); - store->r_bin(store, data.v, (size_t) len); - a->data.v = 0; - ur_add(data, a, resolve_bson); - return AT_READ_OK; -} - -attrib_type at_lua_ext = { - "lua", init_ext, free_ext, age_ext, write_ext, read_ext -}; - -static attrib **get_attribs(lua_State * L, int idx) -{ - attrib **ap = NULL; - tolua_Error tolua_err; - - if (tolua_isusertype(L, idx, TOLUA_CAST "unit", 0, &tolua_err)) { - unit *u = (unit *) tolua_tousertype(L, idx, 0); - if (u) - ap = &u->attribs; - } else if (tolua_isusertype(L, idx, TOLUA_CAST "region", 0, &tolua_err)) { - region *r = (region *) tolua_tousertype(L, idx, 0); - if (r) - ap = &r->attribs; - } else if (tolua_isusertype(L, idx, TOLUA_CAST "faction", 0, &tolua_err)) { - faction *f = (faction *) tolua_tousertype(L, idx, 0); - if (f) - ap = &f->attribs; - } else if (lua_isstring(L, idx)) { - const char *str = tolua_tostring(L, idx, NULL); - if (str && strcmp(str, "global") == 0) { - ap = &global.attribs; - } - } - return ap; -} - -static int tolua_attrib_create(lua_State * L) -{ - attrib **ap = get_attribs(L, 1); - if (ap) { - attrib *a = a_new(&at_lua_ext); - int handle; - - lua_pushvalue(L, 2); - handle = luaL_ref(L, LUA_REGISTRYINDEX); - a->data.i = handle; - - a_add(ap, a); - tolua_pushusertype(L, (void *)a, TOLUA_CAST "attrib"); - return 1; - } - return 0; -} - -int tolua_attrib_data(lua_State * L) -{ - attrib *a = (attrib *) tolua_tousertype(L, 1, 0); - if (a && a->data.i) { - lua_rawgeti(L, LUA_REGISTRYINDEX, a->data.i); - return 1; - } - return 0; -} - -attrib *tolua_get_lua_ext(struct attrib * alist) -{ - while (alist && alist->type != &at_lua_ext) - alist = alist->next; - return alist; -} - -int tolua_attriblist_next(lua_State * L) -{ - attrib **attrib_ptr = (attrib **) lua_touserdata(L, lua_upvalueindex(1)); - attrib *a = *attrib_ptr; - if (a != NULL) { - tolua_pushusertype(L, (void *)a, TOLUA_CAST "attrib"); - *attrib_ptr = tolua_get_lua_ext(a->next); - return 1; - } else - return 0; /* no more values to return */ -} - -int tolua_attrib_get(lua_State * L) -{ - attrib **ap = get_attribs(L, 1); - if (ap) { - attrib *a = tolua_get_lua_ext(*ap); - attrib **attrib_ptr = (attrib **) lua_newuserdata(L, sizeof(attrib *)); - luaL_getmetatable(L, "attrib"); - lua_setmetatable(L, -2); - *attrib_ptr = a; - lua_pushcclosure(L, tolua_attriblist_next, 1); - return 1; - } else - return 0; -} - -void tolua_attrib_open(lua_State * L) -{ - at_register(&at_lua_ext); - - tolua_usertype(L, TOLUA_CAST "attrib"); - - tolua_module(L, NULL, 0); - tolua_beginmodule(L, NULL); - { - tolua_cclass(L, TOLUA_CAST "attrib", TOLUA_CAST "attrib", TOLUA_CAST "", - NULL); - tolua_beginmodule(L, TOLUA_CAST "attrib"); - { - tolua_function(L, TOLUA_CAST "create", &tolua_attrib_create); - tolua_function(L, TOLUA_CAST "get", &tolua_attrib_get); - tolua_variable(L, TOLUA_CAST "data", &tolua_attrib_data, NULL); - } - tolua_endmodule(L); - } - tolua_endmodule(L); -} diff --git a/src/bind_attrib.h b/src/bind_attrib.h deleted file mode 100644 index 6195e109d..000000000 --- a/src/bind_attrib.h +++ /dev/null @@ -1,26 +0,0 @@ -/* vi: set ts=2: -+-------------------+ -| | Enno Rehling -| Eressea PBEM host | Christian Schlittchen -| (c) 1998 - 2010 | Katja Zedel -| | Henning Peters -+-------------------+ - -This program may not be used, modified or distributed -without prior permission by the authors of Eressea. -*/ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - struct attrib; - void tolua_attrib_open(struct lua_State *L); - struct attrib *tolua_get_lua_ext(struct attrib *alist); - int tolua_attriblist_next(struct lua_State *L); - -#ifdef __cplusplus -} -#endif diff --git a/src/bind_message.c b/src/bind_message.c index 77a30e493..4b1b8069d 100644 --- a/src/bind_message.c +++ b/src/bind_message.c @@ -4,7 +4,7 @@ /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/bind_unit.c b/src/bind_unit.c index 3b65a7190..e54356d13 100755 --- a/src/bind_unit.c +++ b/src/bind_unit.c @@ -31,7 +31,7 @@ without prior permission by the authors of Eressea. #include #include #include -#include +#include #include #include #include diff --git a/src/bindings.c b/src/bindings.c index 3d8a83388..1a97e7228 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -34,7 +34,7 @@ without prior permission by the authors of Eressea. #include #include #include -#include +#include #include #include #include diff --git a/src/creport.c b/src/creport.c index 304031b40..20f3130d1 100644 --- a/src/creport.c +++ b/src/creport.c @@ -40,7 +40,7 @@ without prior permission by the authors of Eressea. #include #include #include -#include +#include #include #include #include diff --git a/src/economy.c b/src/economy.c index 8c2851ee6..ca7690b21 100644 --- a/src/economy.c +++ b/src/economy.c @@ -37,7 +37,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include @@ -61,7 +61,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include diff --git a/src/give.c b/src/give.c index c6760f671..c51f3a67a 100644 --- a/src/give.c +++ b/src/give.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/items.c b/src/items.c index 3bee2c18f..843f8477b 100644 --- a/src/items.c +++ b/src/items.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/items/artrewards.c b/src/items/artrewards.c index a5b67bc58..808f289f8 100644 --- a/src/items/artrewards.c +++ b/src/items/artrewards.c @@ -29,7 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include diff --git a/src/items/demonseye.c b/src/items/demonseye.c index 20c0901cc..2084da4de 100644 --- a/src/items/demonseye.c +++ b/src/items/demonseye.c @@ -23,7 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/items/phoenixcompass.c b/src/items/phoenixcompass.c index 1aa6b3d2e..2e754795c 100644 --- a/src/items/phoenixcompass.c +++ b/src/items/phoenixcompass.c @@ -26,7 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include /* util includes */ #include diff --git a/src/items/speedsail.c b/src/items/speedsail.c index 00b31b41b..254bc1e6a 100644 --- a/src/items/speedsail.c +++ b/src/items/speedsail.c @@ -23,7 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/items/weapons.c b/src/items/weapons.c index e80e850e5..02d6abff4 100644 --- a/src/items/weapons.c +++ b/src/items/weapons.c @@ -24,7 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include diff --git a/src/items/xerewards.c b/src/items/xerewards.c index 08a92c92e..a22de46be 100644 --- a/src/items/xerewards.c +++ b/src/items/xerewards.c @@ -27,7 +27,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index 1848025bf..ad513f1cb 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -35,7 +35,7 @@ faction.c group.c item.c magic.c -message.c +messages.c move.c names.c order.c diff --git a/src/kernel/alchemy.c b/src/kernel/alchemy.c index 07501b215..0851f66e3 100644 --- a/src/kernel/alchemy.c +++ b/src/kernel/alchemy.c @@ -22,7 +22,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "item.h" #include "faction.h" -#include "message.h" +#include "messages.h" #include "build.h" #include "magic.h" #include "region.h" diff --git a/src/kernel/alliance.c b/src/kernel/alliance.c index 31aee31d1..e9bee8f2c 100644 --- a/src/kernel/alliance.c +++ b/src/kernel/alliance.c @@ -19,7 +19,7 @@ without prior permission by the authors of Eressea. /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/kernel/battle.c b/src/kernel/battle.c index 938001a4c..408549d62 100644 --- a/src/kernel/battle.c +++ b/src/kernel/battle.c @@ -30,7 +30,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "group.h" #include "item.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "move.h" #include "names.h" #include "order.h" diff --git a/src/kernel/build.c b/src/kernel/build.c index 79963d2cc..38d17e061 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -30,7 +30,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "group.h" #include "item.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "move.h" #include "order.h" #include "pool.h" diff --git a/src/kernel/config.c b/src/kernel/config.c index 5231ca2a5..9a5d8655e 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -36,7 +36,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "group.h" #include "item.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "move.h" #include "names.h" #include "objtypes.h" diff --git a/src/kernel/curse.c b/src/kernel/curse.c index f5be58b17..63e143891 100644 --- a/src/kernel/curse.c +++ b/src/kernel/curse.c @@ -24,7 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "building.h" #include "faction.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "objtypes.h" #include "race.h" #include "region.h" diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 34d7071e2..5d8f886b1 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -25,7 +25,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "equipment.h" #include "group.h" #include "item.h" -#include "message.h" +#include "messages.h" #include "plane.h" #include "race.h" #include "region.h" diff --git a/src/kernel/item.c b/src/kernel/item.c index 21346aedf..c4210999e 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -26,7 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "build.h" #include "curse.h" #include "faction.h" -#include "message.h" +#include "messages.h" #include "pool.h" #include "race.h" #include "region.h" diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index 16e0fa28a..c030968d1 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -18,7 +18,7 @@ without prior permission by the authors of Eressea. #include "building.h" #include "equipment.h" #include "item.h" -#include "message.h" +#include "messages.h" #include "race.h" #include "region.h" #include "resources.h" @@ -145,3 +145,4 @@ void json_config(cJSON *json) { json_races(child); } } + diff --git a/src/kernel/magic.c b/src/kernel/magic.c index d9bad64e8..00e221237 100644 --- a/src/kernel/magic.c +++ b/src/kernel/magic.c @@ -25,7 +25,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "curse.h" #include "faction.h" #include "item.h" -#include "message.h" +#include "messages.h" #include "objtypes.h" #include "order.h" #include "pathfinder.h" diff --git a/src/kernel/message.c b/src/kernel/messages.c similarity index 99% rename from src/kernel/message.c rename to src/kernel/messages.c index d5d2aa20c..9adb32abe 100644 --- a/src/kernel/message.c +++ b/src/kernel/messages.c @@ -18,7 +18,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#include "message.h" +#include "messages.h" /* kernel includes */ #include "building.h" diff --git a/src/kernel/message.h b/src/kernel/messages.h similarity index 96% rename from src/kernel/message.h rename to src/kernel/messages.h index 9820950be..5be1a88fb 100644 --- a/src/kernel/message.h +++ b/src/kernel/messages.h @@ -24,11 +24,8 @@ extern "C" { #include - struct message; - struct faction; - struct msglevel; - - struct message_type; + struct faction; + struct msglevel; typedef struct mlist { struct mlist *next; diff --git a/src/kernel/move.c b/src/kernel/move.c index fb975adb8..4d919be16 100644 --- a/src/kernel/move.c +++ b/src/kernel/move.c @@ -29,7 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "faction.h" #include "item.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "order.h" #include "plane.h" #include "race.h" diff --git a/src/kernel/region.c b/src/kernel/region.c index c177d8acf..d7eeea3c2 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -28,7 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "equipment.h" #include "faction.h" #include "item.h" -#include "message.h" +#include "messages.h" #include "plane.h" #include "region.h" #include "resources.h" diff --git a/src/kernel/render.h b/src/kernel/render.h index d4eacba20..abe43ec39 100644 --- a/src/kernel/render.h +++ b/src/kernel/render.h @@ -16,7 +16,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ -#include +#include #include #include diff --git a/src/kernel/reports.c b/src/kernel/reports.c index f4b0096c0..3eac8c046 100644 --- a/src/kernel/reports.c +++ b/src/kernel/reports.c @@ -28,7 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/kernel/save.c b/src/kernel/save.c index 6871258cc..f31c60e2b 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -29,7 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "group.h" #include "item.h" #include "magic.h" -#include "message.h" +#include "messages.h" #include "move.h" #include "objtypes.h" #include "order.h" diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index 540f36ee0..0d1d7bd26 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -18,7 +18,7 @@ without prior permission by the authors of Eressea. #include "building.h" #include "equipment.h" #include "item.h" -#include "message.h" +#include "messages.h" #include "race.h" #include "region.h" #include "resources.h" diff --git a/src/laws.c b/src/laws.c index 90c9ab697..1229559b9 100755 --- a/src/laws.c +++ b/src/laws.c @@ -45,7 +45,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/market.c b/src/market.c index 274872fca..aea233570 100644 --- a/src/market.c +++ b/src/market.c @@ -23,7 +23,7 @@ without prior permission by the authors of Eressea. #include #include #include -#include +#include #include #include #include diff --git a/src/modules/arena.c b/src/modules/arena.c index c9140bb08..3b741cdb3 100644 --- a/src/modules/arena.c +++ b/src/modules/arena.c @@ -36,7 +36,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/modules/gmcmd.c b/src/modules/gmcmd.c index 12845df9d..db8cab923 100644 --- a/src/modules/gmcmd.c +++ b/src/modules/gmcmd.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/modules/museum.c b/src/modules/museum.c index 43b5e7e6e..dce1c73cd 100644 --- a/src/modules/museum.c +++ b/src/modules/museum.c @@ -28,7 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/modules/wormhole.c b/src/modules/wormhole.c index c20d6c39f..30184db43 100644 --- a/src/modules/wormhole.c +++ b/src/modules/wormhole.c @@ -19,7 +19,7 @@ /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/monster.c b/src/monster.c index 3d643b75f..3118d7d93 100644 --- a/src/monster.c +++ b/src/monster.c @@ -36,7 +36,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/monsters.c b/src/monsters.c index f8c6ddd5d..e94a04991 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/platform.h b/src/platform.h index 464fed5fa..593b0dcd0 100644 --- a/src/platform.h +++ b/src/platform.h @@ -114,3 +114,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #endif + diff --git a/src/races/illusion.c b/src/races/illusion.c index f0853965a..38b1b9d19 100644 --- a/src/races/illusion.c +++ b/src/races/illusion.c @@ -18,7 +18,7 @@ /* kernel includes */ #include #include -#include +#include /* libc includes */ #include diff --git a/src/randenc.c b/src/randenc.c index 834965e77..7fc7ad943 100644 --- a/src/randenc.c +++ b/src/randenc.c @@ -32,7 +32,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include @@ -56,8 +56,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include +#include #include /* libc includes */ diff --git a/src/report.c b/src/report.c index 261d0a2cc..3e87dc98c 100644 --- a/src/report.c +++ b/src/report.c @@ -47,7 +47,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/spells/alp.c b/src/spells/alp.c index cfffb0b87..7dc6e53fc 100644 --- a/src/spells/alp.c +++ b/src/spells/alp.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/spells/borders.c b/src/spells/borders.c index 9f62ad15b..fd71ff647 100644 --- a/src/spells/borders.c +++ b/src/spells/borders.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/spells/buildingcurse.c b/src/spells/buildingcurse.c index dd9cc632e..142ca66fa 100644 --- a/src/spells/buildingcurse.c +++ b/src/spells/buildingcurse.c @@ -16,7 +16,7 @@ #include "buildingcurse.h" /* kernel includes */ -#include +#include #include #include #include diff --git a/src/spells/combatspells.c b/src/spells/combatspells.c index 2176336c5..b02316b77 100644 --- a/src/spells/combatspells.c +++ b/src/spells/combatspells.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/spells/regioncurse.c b/src/spells/regioncurse.c index 14fc7ee5b..5a2d9a5a6 100644 --- a/src/spells/regioncurse.c +++ b/src/spells/regioncurse.c @@ -18,7 +18,7 @@ /* kernel includes */ #include #include -#include +#include #include #include #include diff --git a/src/spells/shipcurse.c b/src/spells/shipcurse.c index 4c23625ba..71906821f 100644 --- a/src/spells/shipcurse.c +++ b/src/spells/shipcurse.c @@ -17,7 +17,7 @@ #include "shipcurse.h" /* kernel includes */ -#include +#include #include #include #include diff --git a/src/spells/spells.c b/src/spells/spells.c index d0acc6356..644ba60ec 100644 --- a/src/spells/spells.c +++ b/src/spells/spells.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/spells/unitcurse.c b/src/spells/unitcurse.c index 8a127f2ce..b996c5563 100644 --- a/src/spells/unitcurse.c +++ b/src/spells/unitcurse.c @@ -17,7 +17,7 @@ /* kernel includes */ #include -#include +#include #include #include #include diff --git a/src/spy.c b/src/spy.c index 4c794939a..b50a67bcb 100644 --- a/src/spy.c +++ b/src/spy.c @@ -26,7 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/study.c b/src/study.c index d3d9ee10a..aa7be1e73 100644 --- a/src/study.c +++ b/src/study.c @@ -29,7 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/triggers/shock.c b/src/triggers/shock.c index f8768be88..489966905 100644 --- a/src/triggers/shock.c +++ b/src/triggers/shock.c @@ -24,7 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include +#include #include #include #include diff --git a/src/triggers/unitmessage.c b/src/triggers/unitmessage.c index 2b639056f..764c9cda0 100644 --- a/src/triggers/unitmessage.c +++ b/src/triggers/unitmessage.c @@ -14,7 +14,7 @@ without prior permission by the authors of Eressea. /* kernel includes */ #include #include -#include +#include /* util includes */ #include diff --git a/src/util/message.h b/src/util/message.h index b5fb81185..446e0ffc3 100644 --- a/src/util/message.h +++ b/src/util/message.h @@ -9,8 +9,8 @@ This program may not be used, modified or distributed without prior permission by the authors of Eressea. */ -#ifndef UTIL_MESSAGE_H -#define UTIL_MESSAGE_H +#ifndef H_MESSAGE_H +#define H_MESSAGE_H #include "variant.h" @@ -18,8 +18,6 @@ extern "C" { #endif - struct locale; - typedef struct arg_type { struct arg_type *next; variant_type vtype; @@ -71,3 +69,4 @@ extern "C" { } #endif #endif + diff --git a/src/xmlreport.c b/src/xmlreport.c index fd6321b6e..0be472540 100644 --- a/src/xmlreport.c +++ b/src/xmlreport.c @@ -39,7 +39,7 @@ without prior permission by the authors of Eressea. #include #include #include -#include +#include #include #include #include