lib: posix: move fnmatch from lib/util to lib/posix
The `fnmatch()` function is specified by POSIX and should be a part of `lib/posix`. Signed-off-by: Chris Friedt <cfriedt@meta.com>
This commit is contained in:
parent
afd4346965
commit
f923441146
11 changed files with 11 additions and 38 deletions
|
|
@ -7,6 +7,5 @@ endif()
|
|||
add_subdirectory_ifdef(CONFIG_CPP cpp)
|
||||
add_subdirectory(hash)
|
||||
add_subdirectory(os)
|
||||
add_subdirectory(util)
|
||||
add_subdirectory_ifdef(CONFIG_SMF smf)
|
||||
add_subdirectory_ifdef(CONFIG_OPENAMP open-amp)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ source "lib/posix/Kconfig"
|
|||
|
||||
source "lib/open-amp/Kconfig"
|
||||
|
||||
source "lib/util/Kconfig"
|
||||
|
||||
source "lib/smf/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_key.c)
|
|||
zephyr_library_sources_ifdef(CONFIG_POSIX_MQUEUE mqueue.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_POSIX_FS fs.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_EVENTFD eventfd.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_FNMATCH fnmatch.c)
|
||||
add_subdirectory_ifdef(CONFIG_GETOPT getopt)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
|
|
|
|||
|
|
@ -156,3 +156,10 @@ config EVENTFD_MAX
|
|||
range 1 4096
|
||||
help
|
||||
The maximum number of supported event file descriptors.
|
||||
|
||||
config FNMATCH
|
||||
bool "Support for fnmatch"
|
||||
default y if POSIX_API
|
||||
help
|
||||
Match filenames using the the fnmatch function. For example, the pattern
|
||||
"*.c" matches the filename "hello.c".
|
||||
|
|
|
|||
|
|
@ -40,9 +40,10 @@
|
|||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include "fnmatch.h"
|
||||
#include <string.h>
|
||||
|
||||
#include <zephyr/posix/fnmatch.h>
|
||||
|
||||
#define EOS '\0'
|
||||
|
||||
static inline int foldcase(int ch, int flags)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_FNMATCH fnmatch)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
|
||||
menu "Util libraries"
|
||||
|
||||
source "lib/util/fnmatch/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# Copyright (c) 2018 Nordic Semiconductor
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
zephyr_include_directories_ifdef(
|
||||
CONFIG_FNMATCH
|
||||
.
|
||||
)
|
||||
|
||||
zephyr_sources_ifdef(
|
||||
CONFIG_FNMATCH
|
||||
fnmatch.c
|
||||
)
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# Copyright (c) 2018 Nordic Semiconductor
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config FNMATCH
|
||||
bool "Fnmatch Support"
|
||||
help
|
||||
This option enables the fnmatch library
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <fnmatch.h>
|
||||
#include <zephyr/posix/fnmatch.h>
|
||||
#include "shell_wildcard.h"
|
||||
#include "shell_utils.h"
|
||||
#include "shell_ops.h"
|
||||
|
|
|
|||
Loading…
Reference in a new issue