diff --git a/src/include/66/module.h b/src/include/66/module.h index fe5c222554487e883fcc4f954ceeeb1782331ab1..20837a2c0601b4c86d7c5ac7672be855e36e2fa1 100644 --- a/src/include/66/module.h +++ b/src/include/66/module.h @@ -41,7 +41,5 @@ extern void regex_get_regex(char *regex, char const *str) ; extern void regex_get_replace(char *replace, char const *str) ; extern void regex_rename(stralloc *list, resolve_service_t *res, uint32_t element) ; extern void regex_replace(stralloc *list, resolve_service_t *res) ; -extern int module_in_cmdline(genalloc *gares, resolve_service_t *res, char const *dir) ; -extern int module_search_service(char const *src, genalloc *gares, char const *name,uint8_t *found, char module_name[256]) ; #endif diff --git a/src/lib66/module/deps-lib/deps b/src/lib66/module/deps-lib/deps index 259e0c49f026422d19f2d9260a2ee1e9c28873ae..a513575fd778a1593d20164b37fd04393134bbab 100644 --- a/src/lib66/module/deps-lib/deps +++ b/src/lib66/module/deps-lib/deps @@ -1,6 +1,4 @@ get_list.o -module_in_cmdline.o -module_search_service.o parse_module.o parse_module_check_dir.o regex_configure.o diff --git a/src/lib66/module/module_in_cmdline.c b/src/lib66/module/module_in_cmdline.c deleted file mode 100644 index 06d297b2b2388b20063bdc1c467434c38d2f3814..0000000000000000000000000000000000000000 --- a/src/lib66/module/module_in_cmdline.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * module_in_cmdline.c - * - * Copyright (c) 2018-2021 Eric Vidal <eric@obarun.org> - * - * All rights reserved. - * - * This file is part of Obarun. It is subject to the license terms in - * the LICENSE file found in the top-level directory of this - * distribution. - * This file may not be copied, modified, propagated, or distributed - * except according to the terms contained in the LICENSE file./ - */ - -#include <stdlib.h> - -#include <oblibs/sastr.h> - -#include <skalibs/genalloc.h> -#include <skalibs/stralloc.h> - -#include <66/service.h> -#include <66/resolve.h> -#include <66/enum.h> -#include <66/utils.h> - -int module_in_cmdline(genalloc *gares, resolve_service_t *res, char const *dir) -{ - log_flow() ; - - int e = 0 ; -/* stralloc tmp = STRALLOC_ZERO ; - size_t pos = 0 ; - resolve_wrapper_t_ref wres = resolve_set_struct(DATA_SERVICE, res) ; - - if (!resolve_append(gares,wres)) goto err ; - - if (res->dependencies.depends) - { - if (!sastr_clean_string(&tmp,res->sa.s + res->dependencies.depends)) - goto err ; - } - for (; pos < tmp.len ; pos += strlen(tmp.s + pos) + 1) - { - char *name = tmp.s + pos ; - if (!resolve_check(dir,name)) goto err ; - if (!resolve_read(wres,dir,name)) goto err ; - if (res->type == TYPE_CLASSIC) - if (resolve_search(gares,name, DATA_SERVICE) < 0) - if (!resolve_append(gares,wres)) goto err ; - } - - e = 1 ; - - err: - free(wres) ; - stralloc_free(&tmp) ; - */ return e ; -} diff --git a/src/lib66/module/module_search_service.c b/src/lib66/module/module_search_service.c deleted file mode 100644 index 5aa0e655c02578872bda4a4c253c9bc8e23ea2ea..0000000000000000000000000000000000000000 --- a/src/lib66/module/module_search_service.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * module_search_service.c - * - * Copyright (c) 2018-2021 Eric Vidal <eric@obarun.org> - * - * All rights reserved. - * - * This file is part of Obarun. It is subject to the license terms in - * the LICENSE file found in the top-level directory of this - * distribution. - * This file may not be copied, modified, propagated, or distributed - * except according to the terms contained in the LICENSE file./ - */ - -#include <sys/types.h> -#include <string.h> - -#include <oblibs/log.h> -#include <oblibs/string.h> -#include <oblibs/sastr.h> - -#include <skalibs/genalloc.h> -#include <skalibs/stralloc.h> - -#include <66/constants.h> -#include <66/service.h> -#include <66/resolve.h> -#include <66/enum.h> -#include <66/utils.h> - -int module_search_service(char const *src, genalloc *gares, char const *name,uint8_t *found, char module_name[256]) -{ - log_flow() ; - - int e = 0 ; - size_t srclen = strlen(src), pos = 0, deps = 0 ; - stralloc list = STRALLOC_ZERO ; - stralloc tmp = STRALLOC_ZERO ; - resolve_service_t res = RESOLVE_SERVICE_ZERO ; - resolve_wrapper_t_ref wres = resolve_set_struct(DATA_SERVICE, &res) ; - char const *exclude[2] = { SS_MASTER + 1, 0 } ; - - char t[srclen + SS_RESOLVE_LEN + 1] ; - auto_strings(t,src,SS_RESOLVE) ; - - if (!sastr_dir_get(&list,t,exclude,S_IFREG)) goto err ; - - for (;pos < list.len ; pos += strlen(list.s + pos) + 1) - { - char *dname = list.s + pos ; - if (!resolve_read(wres,src,dname)) goto err ; - if (res.type == TYPE_MODULE && res.dependencies.depends) - { - if (!sastr_clean_string(&tmp,res.sa.s + res.dependencies.depends)) goto err ; - for (deps = 0 ; deps < tmp.len ; deps += strlen(tmp.s + deps) + 1) - { - if (!strcmp(name,tmp.s + deps)) - { - (*found)++ ; - if (strlen(dname) > 255) log_1_warn_return(LOG_EXIT_ZERO,"module name too long") ; - auto_strings(module_name,dname) ; - goto end ; - } - } - } - } - end: - /** search if the service is on the commandline - * if not we crash */ - for(pos = 0 ; pos < genalloc_len(resolve_service_t,gares) ; pos++) - { - resolve_service_t_ref pres = &genalloc_s(resolve_service_t, gares)[pos] ; - char *str = pres->sa.s ; - char *name = str + pres->name ; - if (!strcmp(name,module_name)) { - (*found) = 0 ; - break ; - } - } - - e = 1 ; - - err: - stralloc_free(&list) ; - stralloc_free(&tmp) ; - resolve_free(wres) ; - return e ; -}