diff options
author | Werner Koch <wk@gnupg.org> | 2018-03-21 16:23:29 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2018-03-21 16:23:29 +0100 |
commit | 13d6fbfd4360cb74588556a3a0058c4057d0bcf0 (patch) | |
tree | f8cecb6515b9056826f95a272560af1fcf68bb9b /src/visibility.h | |
parent | 1beb22fc25f6622002ff592ac4d67400b1a3d3cb (diff) | |
download | libgpg-error-13d6fbfd4360cb74588556a3a0058c4057d0bcf0.tar.gz |
core: Add the group of argparse functions.
* src/visibility.c (gpgrt_argparse): New.
(gpgrt_strusage): New.
(gpgrt_set_strusage): New.
(gpgrt_set_usage_outfnc): New.
(gpgrt_set_fixed_string_mapper): New.
* src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
* src/gpg-error.h.in: Add ARGPARSE macros from the former argparse.h.
(gpgrt_argparse_t): New.
(gpgrt_opt_t): New.
* configure.ac (AH_BOTTOM): Request argparse macros.
* src/Makefile.am (libgpg_error_la_SOURCES): Add argparse.c.
* src/argparse.h: Remove.
* src/argparse.c: Revamp to fit into libgpg-error.
(_gpgrt_argparse): New.
(_gpgrt_usage): Rename from usage.
(_gpgrt_strusage): Rename from strusage. Define two new levels and
templates for three common licenses.
(_gpgrt_set_strusage): Rename from set_strusage.
(_gpgrt_set_usage_outfnc): New.
(_gpgrt_set_fixed_string_mapper): New.
* tests/t-argparse.c: New.
--
These functions are in use by GnuPG and other software for 20 years
and it makes sense to have them always available instead of copying
and maintaing the source in several projects. Note that there are
minor changes in the API compared to GnuPG.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/visibility.h')
-rw-r--r-- | src/visibility.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/visibility.h b/src/visibility.h index f37555a..51d9e38 100644 --- a/src/visibility.h +++ b/src/visibility.h @@ -199,6 +199,12 @@ MARK_VISIBLE (gpgrt_kill_process) MARK_VISIBLE (gpgrt_release_process) #endif +MARK_VISIBLE (gpgrt_argparse) +MARK_VISIBLE (gpgrt_set_strusage) +MARK_VISIBLE (gpgrt_strusage) +MARK_VISIBLE (gpgrt_set_fixed_string_mapper); +MARK_VISIBLE (gpgrt_set_usage_outfnc); + #undef MARK_VISIBLE #else /*!_GPGRT_INCL_BY_VISIBILITY_C*/ @@ -359,6 +365,11 @@ MARK_VISIBLE (gpgrt_release_process) #define gpgrt_kill_process _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_release_process _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_argparse _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_strusage _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_strusage _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_usage_outfnc _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_fixed_string_mapper _gpgrt_USE_UNDERSCORED_FUNCTION /* Windows specific functions. */ #define gpgrt_w32_reg_query_string _gpgrt_USE_UNDERSCORED_FUNCTION |