diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a98372c62609aa17dd2cb12d603a139f4d42d929..a4c2a91e7763f6e4c6bfb984a3fe74bd78642fd6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,10 +70,8 @@ set (common_sources fio.c plugin.c crc32.c - rope.c tbuf.c opts.c - rlist.c cpu_feature.c lua/fiber.cc lua/trigger.cc @@ -102,7 +100,7 @@ set_source_files_compile_flags(${common_sources}) add_library(core STATIC ${common_sources}) add_dependencies(core generate_headers) -set (common_libraries cfg core small) +set (common_libraries cfg core small salad) list(APPEND common_libraries ${LIBEV_LIBRARIES} diff --git a/src/assoc.h b/src/assoc.h index 17577eb2a82098cd365fab76d09d4b95038ff46c..35b8e7538752a8882ac1f33ee2fddcc896202277 100644 --- a/src/assoc.h +++ b/src/assoc.h @@ -51,7 +51,7 @@ struct mh_i32ptr_node_t { #define mh_hash_key(a, arg) (a) #define mh_eq(a, b, arg) ((a->key) == (b->key)) #define mh_eq_key(a, b, arg) ((a) == (b->key)) -#include <mhash.h> +#include "salad/mhash.h" #if defined(__cplusplus) } /* extern "C" */ diff --git a/src/box/box_lua.cc b/src/box/box_lua.cc index f6323c82af113021c350ffcd4534858dc950b85f..1062c1ba1a77797e2bc2b927a6784fe7e4839c0e 100644 --- a/src/box/box_lua.cc +++ b/src/box/box_lua.cc @@ -1711,7 +1711,7 @@ schema_lua_init(struct lua_State *L) } void -mod_lua_init(struct lua_State *L) +box_lua_init(struct lua_State *L) { /* box, box.tuple */ luaL_register_type(L, tuplelib_name, lbox_tuple_meta); diff --git a/src/box/box_lua_space.cc b/src/box/box_lua_space.cc index 20dbec5fd06744c2fee238e4bbf962e126c26bf5..138e079d246157f74afba0bc8051590d67698707 100644 --- a/src/box/box_lua_space.cc +++ b/src/box/box_lua_space.cc @@ -39,7 +39,7 @@ extern "C" { #include "space.h" #include "schema.h" #include <trigger.h> -#include <rlist.h> +#include "salad/rlist.h" #include <scoped_guard.h> #include "box_lua.h" #include "txn.h" diff --git a/src/box/hash_index.cc b/src/box/hash_index.cc index 14682f1c1cf6f14175f4a9773b63906d44d48033..35ea70f5a1456c9602fb5b565d8e1579a8ecf9d8 100644 --- a/src/box/hash_index.cc +++ b/src/box/hash_index.cc @@ -121,7 +121,7 @@ mh_index_hash_key(const char *key, const struct key_def *key_def) typedef struct tuple * mh_node_t; #define mh_name _index #define MH_SOURCE 1 -#include <mhash.h> +#include "salad/mhash.h" /* {{{ HashIndex Iterators ****************************************/ diff --git a/src/box/key_def.h b/src/box/key_def.h index 54d5ff3abcef6eac1855a2329f9688026754a59f..b29aef54403d8cbad83b481aab452268afc34a8e 100644 --- a/src/box/key_def.h +++ b/src/box/key_def.h @@ -29,7 +29,7 @@ * SUCH DAMAGE. */ #include "trivia/util.h" -#include "rlist.h" +#include "salad/rlist.h" #include <exception.h> #include "msgpuck/msgpuck.h" diff --git a/src/box/space.h b/src/box/space.h index 8408a4770fe6261f882b0fd0a2b0c4eac11a0dfa..6f57c0f345087361ae91f32f89e173121516aa8d 100644 --- a/src/box/space.h +++ b/src/box/space.h @@ -30,7 +30,7 @@ */ #include "index.h" #include "key_def.h" -#include "rlist.h" +#include "salad/rlist.h" #include <exception.h> typedef void (*space_f)(struct space *space); diff --git a/src/box/tuple_convert.cc b/src/box/tuple_convert.cc index 41fb74f2a36a14dbbebcc13acc1eeee16a2b46a8..083940938ecf11e14b30eff07b527f0ff969a10c 100644 --- a/src/box/tuple_convert.cc +++ b/src/box/tuple_convert.cc @@ -30,12 +30,6 @@ #include "iobuf.h" #include "tbuf.h" -extern "C" { -#include <lua.h> -#include <lauxlib.h> -#include <lualib.h> -} /* extern "C" */ - void tuple_to_obuf(struct tuple *tuple, struct obuf *buf) { diff --git a/src/box/tuple_update.cc b/src/box/tuple_update.cc index 446a8a776e8dda7d4112c7e7356b784beb4ae36d..d49c399043a35f71ff53c1eb84980e5713e714e4 100644 --- a/src/box/tuple_update.cc +++ b/src/box/tuple_update.cc @@ -31,7 +31,7 @@ #include "third_party/queue.h" -#include <rope.h> +#include "salad/rope.h" #include <exception.h> #include <pickle.h> #include "msgpuck/msgpuck.h" diff --git a/src/coeio.cc b/src/coeio.cc index 9421502bbc86557a2f382aa312bd8f82190987e8..96fd0cd00b9c47706e70b006c02d880853ef585d 100644 --- a/src/coeio.cc +++ b/src/coeio.cc @@ -29,7 +29,6 @@ #include "coeio.h" #include "fiber.h" #include "exception.h" -#include <rlist.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> diff --git a/src/coeio.h b/src/coeio.h index 4fea38d46c30851c9e85a4c3386bf0a5b0194cca..5f52c515951304c11e878b3b262e8988e6684406 100644 --- a/src/coeio.h +++ b/src/coeio.h @@ -39,7 +39,6 @@ #include <tarantool_ev.h> #include <tarantool_eio.h> #include <coro.h> -#include <rlist.h> #include <sys/types.h> #include <sys/socket.h> diff --git a/src/fiber.cc b/src/fiber.cc index 6982668673ac1b617392a50fd3c43d7b92e56853..305385d524989fd3aa12c9214ab3d9e4540ed981 100644 --- a/src/fiber.cc +++ b/src/fiber.cc @@ -35,7 +35,6 @@ #include "say.h" #include "stat.h" #include "assoc.h" -#include "rlist.h" #include "memory.h" enum { FIBER_CALL_STACK = 16 }; diff --git a/src/fiber.h b/src/fiber.h index 1de34ed54c16c9c5e52de4d2e3d808368bf3d6ed..6a1d497e5739df23254d095efe4070ba2d63e677 100644 --- a/src/fiber.h +++ b/src/fiber.h @@ -42,7 +42,7 @@ #if defined(__cplusplus) #include "exception.h" #endif /* defined(__cplusplus) */ -#include "rlist.h" +#include "salad/rlist.h" #define FIBER_NAME_MAX REGION_NAME_MAX #define FIBER_READING_INBOX (1 << 0) diff --git a/src/ipc.cc b/src/ipc.cc index c70454bb65ee693feb4fb6c4b8441036d002ef30..28e958f942e402442f9f3fc71baacdf469166d0e 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -29,7 +29,7 @@ #include "ipc.h" #include "fiber.h" #include <stdlib.h> -#include <rlist.h> +#include "salad/rlist.h" struct ipc_channel { struct rlist readers, writers, bcast; diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 1cdd97dc0f35ffb7392d88212921c048eac05aca..c59a1cc460787153c817240a92e548482e9ea3df 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(bit) add_subdirectory(bitset) add_subdirectory(small) +add_subdirectory(salad) add_library(msgpuck STATIC msgpuck/msgpuck.c) diff --git a/src/lib/small/region.h b/src/lib/small/region.h index 07f80d4f5f5a2dcbad62dc4e85b9eca5d532290c..b974742327ae6685764aff3c4212e1ab615c9fa4 100644 --- a/src/lib/small/region.h +++ b/src/lib/small/region.h @@ -32,7 +32,7 @@ #include <inttypes.h> #include <assert.h> #include <stdio.h> -#include "rlist.h" +#include "salad/rlist.h" #include "slab_cache.h" #ifdef __cplusplus diff --git a/src/lib/small/slab_cache.h b/src/lib/small/slab_cache.h index 8ad797c2ef432c9819a6dee7fed2017d4847d481..86131231b73162d9b8ccbb34fcc1499a90a3425b 100644 --- a/src/lib/small/slab_cache.h +++ b/src/lib/small/slab_cache.h @@ -32,7 +32,7 @@ #include <limits.h> #include <stddef.h> #include <assert.h> -#include "rlist.h" +#include "salad/rlist.h" #include "slab_arena.h" #if defined(__cplusplus) diff --git a/src/lua/init.cc b/src/lua/init.cc index 7c2e6e326ce644aa0b5109a1a33e065ffc178a03..b9f4785bff10c7c09fe3ceae1692b99e0bb9d51a 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -340,7 +340,7 @@ tarantool_lua_init() *s, lua_tostring(L, -1)); } - mod_lua_init(L); + box_lua_init(L); /* init after internal luas are processed */ tarantool_plugin_init(L); diff --git a/src/lua/init.h b/src/lua/init.h index e5a67216f3f4263dff3a86d94c8c0e98aa18e157..6db00dacbc05ad06aadf6e05cf7ec7eb062de7a2 100644 --- a/src/lua/init.h +++ b/src/lua/init.h @@ -43,12 +43,12 @@ struct tbuf; * No return value, panics if error. */ extern void -mod_lua_init(struct lua_State *L); +box_lua_init(struct lua_State *L); /** * Create an instance of Lua interpreter and load it with * Tarantool modules. Creates a Lua state, imports global - * Tarantool modules, then calls mod_lua_init(), which performs + * Tarantool modules, then calls box_lua_init(), which performs * module-specific imports. The created state can be freed as any * other, with lua_close(). * diff --git a/src/mutex.h b/src/mutex.h index 29e656255aa2101c2498880aba2d89db3a2bc3f8..df3b1b1eb73ef9a7adae342424cd6db175fca4d3 100644 --- a/src/mutex.h +++ b/src/mutex.h @@ -31,7 +31,7 @@ #include <assert.h> #include "fiber.h" -#include "rlist.h" +#include "salad/rlist.h" /** Mutex of cooperative multitasking environment. */ diff --git a/src/plugin.h b/src/plugin.h index 03c0d6f03ab12a69267af96a25271804233b8328..1365c676196f77c38f881c297e0fd275644b8fc1 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -36,7 +36,7 @@ extern "C" { #define PLUGIN_API_VERSION 1 #include <stddef.h> -#include "rlist.h" +#include "salad/rlist.h" struct lua_State; struct tbuf; diff --git a/src/trigger.h b/src/trigger.h index d3ebeb17e8f922ca2d57dabe5ad01c06f80102cc..9bf3439cbdeded75652e6e6a50044f866fce1876 100644 --- a/src/trigger.h +++ b/src/trigger.h @@ -28,7 +28,7 @@ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "rlist.h" +#include "salad/rlist.h" /** * Type of the callback which may be invoked * on an event. diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 2afb883c721949ccce4fa62717e52b28cdc21167..f41e42ba7feeadba5d93f1fa933c97ed8010c45a 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -4,13 +4,13 @@ set_source_files_compile_flags(${all_sources}) include_directories(${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_BINARY_DIR}/src) include_directories(${PROJECT_SOURCE_DIR}/src/lib) -add_executable(rlist.test rlist.c test.c ${CMAKE_SOURCE_DIR}/src/rlist.c) +add_executable(rlist.test rlist.c test.c ${CMAKE_SOURCE_DIR}/src/lib/salad/rlist.c) add_executable(queue.test queue.c) add_executable(mhash.test mhash.c) -add_executable(rope_basic.test rope_basic.c ${CMAKE_SOURCE_DIR}/src/rope.c) -add_executable(rope_avl.test rope_avl.c ${CMAKE_SOURCE_DIR}/src/rope.c) -add_executable(rope_stress.test rope_stress.c ${CMAKE_SOURCE_DIR}/src/rope.c) -add_executable(rope.test rope.c ${CMAKE_SOURCE_DIR}/src/rope.c) +add_executable(rope_basic.test rope_basic.c ${CMAKE_SOURCE_DIR}/src/lib/salad/rope.c) +add_executable(rope_avl.test rope_avl.c ${CMAKE_SOURCE_DIR}/src/lib/salad/rope.c) +add_executable(rope_stress.test rope_stress.c ${CMAKE_SOURCE_DIR}/src/lib/salad/rope.c) +add_executable(rope.test rope.c ${CMAKE_SOURCE_DIR}/src/lib/salad/rope.c) add_executable(bit.test bit.c bit.c) target_link_libraries(bit.test bit) add_executable(bitset_basic.test bitset_basic.c) diff --git a/test/unit/mhash.c b/test/unit/mhash.c index 2cf9ff7c843858e44b6814b47fddbae9c8ee6f7c..b3393d31f6e39d3b2ccf1ae6208909a6bf9c008e 100644 --- a/test/unit/mhash.c +++ b/test/unit/mhash.c @@ -13,7 +13,7 @@ struct mh_i32_node_t { #define mh_arg_t void * #define mh_hash(a, arg) (a->key) #define mh_eq(a, b, arg) ((a->key) == (b->key)) -#include "mhash.h" +#include "salad/mhash.h" #define mh_name _i32_collision struct mh_i32_collision_node_t { @@ -25,7 +25,7 @@ struct mh_i32_collision_node_t { #define mh_hash(a, arg) 42 #define mh_eq(a, b, arg) ((a->key) == (b->key)) -#include "mhash.h" +#include "salad/mhash.h" #undef MH_SOURCE diff --git a/test/unit/rlist.c b/test/unit/rlist.c index e530a99238cbd8ef448e9eb87ebd668620bd7c19..fb0ed37eabee1532511535073dff9cccc9bd41ed 100644 --- a/test/unit/rlist.c +++ b/test/unit/rlist.c @@ -1,4 +1,4 @@ -#include <rlist.h> +#include "salad/rlist.h" #include <stdio.h> #include <stdarg.h> #include "test.h" diff --git a/test/unit/rope.c b/test/unit/rope.c index b1119f2efc5e0e46fac9c718e4cc1bae09973cdc..029aedc863571b6c378166ccb9ee103de9f9b871 100644 --- a/test/unit/rope.c +++ b/test/unit/rope.c @@ -1,4 +1,4 @@ -#include <rope.h> +#include "salad/rope.h" #include "unit.h" #include "rope_common.h" diff --git a/test/unit/rope_avl.c b/test/unit/rope_avl.c index c3b51599caa13720cbf8a4faacc8ae6596f7eb4c..9e978f46c0dce09651fb43e338f39c87210d19f6 100644 --- a/test/unit/rope_avl.c +++ b/test/unit/rope_avl.c @@ -1,4 +1,4 @@ -#include <rope.h> +#include "salad/rope.h" #include "unit.h" #include "rope_common.h" diff --git a/test/unit/rope_basic.c b/test/unit/rope_basic.c index 34aaa1c4f3b8eb2cce01667ecae2f5a44ecd7eb2..b4a0e787604adc4cd4e3283afcbc434ee04ae452 100644 --- a/test/unit/rope_basic.c +++ b/test/unit/rope_basic.c @@ -1,4 +1,4 @@ -#include <rope.h> +#include "salad/rope.h" #include "unit.h" #include "rope_common.h" diff --git a/test/unit/rope_stress.c b/test/unit/rope_stress.c index be617b9d96c6d5fa3b7b1bbdc823cdafef187c67..35c43a7a7cb15e65af36ec4cdb9db1ad484a40b5 100644 --- a/test/unit/rope_stress.c +++ b/test/unit/rope_stress.c @@ -1,4 +1,4 @@ -#include <rope.h> +#include "salad/rope.h" #include <time.h> #include "unit.h" #include "rope_common.h"