--- lbbs/src/test_file_loader.c 2025/05/25 06:48:31 1.5 +++ lbbs/src/test_file_loader.c 2025/11/04 13:49:51 1.10 @@ -1,25 +1,17 @@ -/*************************************************************************** - file_loader.c - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * test_file_loader + * - tester for shared memory based file loader + * + * Copyright (C) 2004-2025 by Leaflet + */ #include "file_loader.h" -#include "trie_dict.h" #include "log.h" +#include "trie_dict.h" +#include #include #include -#include #include #define TRIE_DICT_SHM_FILE "~trie_dict_shm.dat" @@ -51,8 +43,8 @@ int main(int argc, char *argv[]) return -1; } - log_std_redirect(STDOUT_FILENO); - log_err_redirect(STDERR_FILENO); + log_common_redir(STDOUT_FILENO); + log_error_redir(STDERR_FILENO); if ((fp = fopen(TRIE_DICT_SHM_FILE, "w")) == NULL) { @@ -61,7 +53,7 @@ int main(int argc, char *argv[]) } fclose(fp); - if (trie_dict_init(TRIE_DICT_SHM_FILE) < 0) + if (trie_dict_init(TRIE_DICT_SHM_FILE, TRIE_NODE_PER_POOL) < 0) { printf("trie_dict_init failed\n"); return -1;