Commit graph

4 commits

Author SHA1 Message Date
Chris Friedt f923441146 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>
2023-03-03 17:40:14 +09:00
Jakub Rzeszutko d4559f53fa lib: getopt: rework and extend getopt library
Getopt has been rework in this way that calling it does not require
extra state parameter and its execution is thread safe.
Global parameters describing the state of the getopt function have been
made available to ensure full API compatibility in using this library.
However, referencing these global variables directly is not thread
safe. In order to get the state of the getopt function for the thread
that is currently using it, call: getopt_state_get();

Extended the library with getopt_long and getopt_long_only functions.

Moved getopt libary from utils to posix.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2022-01-06 21:26:59 +01:00
Jakub Rzeszutko ddb07f57ec lib: add freebsd getopt library
This library is going to be used by the shell module. Some shell users
are not satisfied with subcommands alone and need to use the options
for commands as well.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko 72dd5a5c68 lib: move fnmatch to lib/util
We expect to have more libraries with incopatible license. There must
be a common place for such software. It seems that lib/util is good
place for that.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00