Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(WARNINGS_ENABLED)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wunused)
#add_compile_options(-Wshadow)
add_compile_options(-Wshadow)
add_compile_options(-Wignored-qualifiers)
add_compile_options(-Wmissing-braces)
add_compile_options(-Wreturn-type)
Expand Down
30 changes: 15 additions & 15 deletions source/configuration/source/configuration.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Configuration Library by Parra Studios
* Copyright (C) 2016 - 2026 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
*
* A cross-platform library for managing multiple configuration formats.
*
*/
* Configuration Library by Parra Studios
* Copyright (C) 2016 - 2026 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
*
* A cross-platform library for managing multiple configuration formats.
*
*/

/* -- Headers -- */

Expand Down Expand Up @@ -71,11 +71,11 @@ int configuration_initialize(const char *reader, const char *path, void *allocat
}

/* The order of precedence is:
* 1) Environment variable
* 2) Default relative path to metacall library
* 3) Locate it relative to metacall library install path
* 4) Default installation path (if any)
*/
* 1) Environment variable
* 2) Default relative path to metacall library
* 3) Locate it relative to metacall library install path
* 4) Default installation path (if any)
*/
if (path == NULL)
{
static const char configuration_path[] = CONFIGURATION_PATH;
Expand Down Expand Up @@ -198,20 +198,20 @@ int configuration_initialize(const char *reader, const char *path, void *allocat
return 1;
}

configuration configuration_create(const char *scope, const char *path, const char *parent, void *allocator)
configuration configuration_create(const char *scope_name, const char *path, const char *parent, void *allocator)
{
configuration config = configuration_singleton_get(scope);
configuration config = configuration_singleton_get(scope_name);

if (config != NULL)
{
return config;
}

config = configuration_object_initialize(scope, path, configuration_scope(parent));
config = configuration_object_initialize(scope_name, path, configuration_scope(parent));

if (config == NULL)
{
log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration (%s) scope map creation [%s]", scope, path);
log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration (%s) scope map creation [%s]", scope_name, path);

return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion source/loader/include/loader/loader_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ LOADER_API value loader_impl_get_value(loader_impl impl, const char *name);

LOADER_API context loader_impl_context(loader_impl impl);

LOADER_API type loader_impl_type(loader_impl impl, const char *name);
LOADER_API type loader_impl_get_type(loader_impl impl, const char *name);

LOADER_API int loader_impl_type_define(loader_impl impl, const char *name, type t);

Expand Down
4 changes: 2 additions & 2 deletions source/loader/source/loader_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ int loader_host_register(loader_impl host, context ctx, const char *name, loader
{
static const char empty_argument_name[] = "";

type t = loader_impl_type(host, type_id_name(args_type_id[iterator]));
type t = loader_impl_get_type(host, type_id_name(args_type_id[iterator]));

signature_set(s, iterator, empty_argument_name, t);
}

type t = loader_impl_type(host, type_id_name(return_type));
type t = loader_impl_get_type(host, type_id_name(return_type));

signature_set_return(s, t);

Expand Down
10 changes: 5 additions & 5 deletions source/loader/source/loader_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@

/* -- Forward Declarations -- */

struct loader_handle_impl_type;
struct loader_handle_impl_s;

/* -- Type Definitions -- */

typedef struct loader_handle_impl_type *loader_handle_impl;
typedef struct loader_handle_impl_s *loader_handle_impl;

/* -- Member Data -- */

Expand All @@ -90,7 +90,7 @@ struct loader_impl_type
set detour_map; /* List of detour handles (detour_handle) to the dependencies of the loader and the loader itself */
};

struct loader_handle_impl_type
struct loader_handle_impl_s
{
uintptr_t magic; /* Magic number for detecting corrupted input by the user */
loader_impl impl; /* Reference to the loader which handle belongs to */
Expand Down Expand Up @@ -846,7 +846,7 @@ context loader_impl_context(loader_impl impl)
return NULL;
}

type loader_impl_type(loader_impl impl, const char *name)
type loader_impl_get_type(loader_impl impl, const char *name)
{
if (impl != NULL && impl->type_info_map != NULL && name != NULL)
{
Expand All @@ -868,7 +868,7 @@ int loader_impl_type_define(loader_impl impl, const char *name, type t)

loader_handle_impl loader_impl_load_handle(loader_impl impl, loader_impl_interface iface, loader_handle module, const char *path, size_t size)
{
loader_handle_impl handle_impl = malloc(sizeof(struct loader_handle_impl_type));
loader_handle_impl handle_impl = malloc(sizeof(struct loader_handle_impl_s));

if (handle_impl == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion source/loaders/c_loader/source/c_loader_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXType cx_ty
type c_loader_impl_discover_type(loader_impl impl, CXCursor &cursor, CXType &cx_type)
{
auto type_str = c_loader_impl_cxstring_to_str(clang_getTypeSpelling(cx_type));
type t = loader_impl_type(impl, type_str.c_str());
type t = loader_impl_get_type(impl, type_str.c_str());

if (t != NULL)
{
Expand Down
4 changes: 2 additions & 2 deletions source/loaders/cs_loader/source/cs_loader_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ int cs_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx)
{
signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, cs_loader_impl_discover_type(functions[i].return_type)));
signature_set_return(s, loader_impl_get_type(impl, cs_loader_impl_discover_type(functions[i].return_type)));

for (int j = 0; j < functions[i].param_count; ++j)
{
type t = loader_impl_type(impl, cs_loader_impl_discover_type(functions[i].pars[j].type));
type t = loader_impl_get_type(impl, cs_loader_impl_discover_type(functions[i].pars[j].type));

signature_set(s, j, functions[i].pars[j].name, t);
}
Expand Down
42 changes: 21 additions & 21 deletions source/loaders/dart_loader/source/dart_loader_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Integer"));
signature_set_return(s, loader_impl_get_type(impl, "Integer"));

value v = value_create_function(f);

Expand All @@ -457,11 +457,11 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Double"));
signature_set_return(s, loader_impl_get_type(impl, "Double"));

signature_set(s, 0, "first_parameter", loader_impl_type(impl, "Double"));
signature_set(s, 0, "first_parameter", loader_impl_get_type(impl, "Double"));

signature_set(s, 1, "second_parameter", loader_impl_type(impl, "Double"));
signature_set(s, 1, "second_parameter", loader_impl_get_type(impl, "Double"));

value v = value_create_function(f);

Expand All @@ -480,17 +480,17 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Char"));
signature_set_return(s, loader_impl_get_type(impl, "Char"));

signature_set(s, 0, "a_char", loader_impl_type(impl, "Char"));
signature_set(s, 0, "a_char", loader_impl_get_type(impl, "Char"));

signature_set(s, 1, "b_int", loader_impl_type(impl, "Integer"));
signature_set(s, 1, "b_int", loader_impl_get_type(impl, "Integer"));

signature_set(s, 2, "c_long", loader_impl_type(impl, "Long"));
signature_set(s, 2, "c_long", loader_impl_get_type(impl, "Long"));

signature_set(s, 3, "d_double", loader_impl_type(impl, "Double"));
signature_set(s, 3, "d_double", loader_impl_get_type(impl, "Double"));

signature_set(s, 4, "e_ptr", loader_impl_type(impl, "Ptr"));
signature_set(s, 4, "e_ptr", loader_impl_get_type(impl, "Ptr"));

value v = value_create_function(f);

Expand All @@ -509,9 +509,9 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "String"));
signature_set_return(s, loader_impl_get_type(impl, "String"));

signature_set(s, 0, "a_str", loader_impl_type(impl, "String"));
signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String"));

value v = value_create_function(f);

Expand All @@ -530,11 +530,11 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "String"));
signature_set_return(s, loader_impl_get_type(impl, "String"));

signature_set(s, 0, "a_str", loader_impl_type(impl, "String"));
signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String"));

signature_set(s, 1, "b_str", loader_impl_type(impl, "String"));
signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String"));

value v = value_create_function(f);

Expand All @@ -553,13 +553,13 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "String"));
signature_set_return(s, loader_impl_get_type(impl, "String"));

signature_set(s, 0, "a_str", loader_impl_type(impl, "String"));
signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String"));

signature_set(s, 1, "b_str", loader_impl_type(impl, "String"));
signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String"));

signature_set(s, 2, "c_str", loader_impl_type(impl, "String"));
signature_set(s, 2, "c_str", loader_impl_get_type(impl, "String"));

value v = value_create_function(f);

Expand All @@ -578,7 +578,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "String"));
signature_set_return(s, loader_impl_get_type(impl, "String"));

value v = value_create_function(f);

Expand All @@ -597,7 +597,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Integer"));
signature_set_return(s, loader_impl_get_type(impl, "Integer"));

value v = value_create_function(f);

Expand Down
2 changes: 1 addition & 1 deletion source/loaders/file_loader/source/file_loader_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ int file_loader_impl_discover(loader_impl impl, loader_handle handle, context ct

s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Path"));
signature_set_return(s, loader_impl_get_type(impl, "Path"));

v = value_create_function(f);

Expand Down
2 changes: 1 addition & 1 deletion source/loaders/java_loader/source/java_loader_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static type_interface type_java_singleton(void);

static type java_loader_impl_type(loader_impl impl, const char *type_str, const char *type_signature)
{
type t = loader_impl_type(impl, type_str);
type t = loader_impl_get_type(impl, type_str);

if (t != NULL)
{
Expand Down
4 changes: 2 additions & 2 deletions source/loaders/js_loader/source/js_loader_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ typedef class loader_impl_js_handle_type

parameter_list::iterator param_it;

type ret_type = loader_impl_type(impl, js_f->return_type.c_str());
type ret_type = loader_impl_get_type(impl, js_f->return_type.c_str());

signature_set_return(s, ret_type);

for (param_it = js_f->parameters.begin();
param_it != js_f->parameters.end(); ++param_it)
{
type t = loader_impl_type(impl, param_it->type.c_str());
type t = loader_impl_get_type(impl, param_it->type.c_str());

signature_set(s, param_it->index, param_it->name.c_str(), t);
}
Expand Down
2 changes: 1 addition & 1 deletion source/loaders/lua_loader/source/lua_loader_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ int lua_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Integer"));
signature_set_return(s, loader_impl_get_type(impl, "Integer"));

value v = value_create_function(f);

Expand Down
24 changes: 12 additions & 12 deletions source/loaders/mock_loader/source/mock_loader_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Integer"));
signature_set_return(s, loader_impl_get_type(impl, "Integer"));

value v = value_create_function(f);

Expand All @@ -111,11 +111,11 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Double"));
signature_set_return(s, loader_impl_get_type(impl, "Double"));

signature_set(s, 0, "first_parameter", loader_impl_type(impl, "Double"));
signature_set(s, 0, "first_parameter", loader_impl_get_type(impl, "Double"));

signature_set(s, 1, "second_parameter", loader_impl_type(impl, "Double"));
signature_set(s, 1, "second_parameter", loader_impl_get_type(impl, "Double"));

value v = value_create_function(f);

Expand All @@ -134,17 +134,17 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "Char"));
signature_set_return(s, loader_impl_get_type(impl, "Char"));

signature_set(s, 0, "a_char", loader_impl_type(impl, "Char"));
signature_set(s, 0, "a_char", loader_impl_get_type(impl, "Char"));

signature_set(s, 1, "b_int", loader_impl_type(impl, "Integer"));
signature_set(s, 1, "b_int", loader_impl_get_type(impl, "Integer"));

signature_set(s, 2, "c_long", loader_impl_type(impl, "Long"));
signature_set(s, 2, "c_long", loader_impl_get_type(impl, "Long"));

signature_set(s, 3, "d_double", loader_impl_type(impl, "Double"));
signature_set(s, 3, "d_double", loader_impl_get_type(impl, "Double"));

signature_set(s, 4, "e_ptr", loader_impl_type(impl, "Ptr"));
signature_set(s, 4, "e_ptr", loader_impl_get_type(impl, "Ptr"));

value v = value_create_function(f);

Expand All @@ -163,9 +163,9 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con

signature s = function_signature(f);

signature_set_return(s, loader_impl_type(impl, "String"));
signature_set_return(s, loader_impl_get_type(impl, "String"));

signature_set(s, 0, "str", loader_impl_type(impl, "String"));
signature_set(s, 0, "str", loader_impl_get_type(impl, "String"));

value v = value_create_function(f);

Expand Down
Loading
Loading