From 13d6fbfd4360cb74588556a3a0058c4057d0bcf0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 21 Mar 2018 16:23:29 +0100 Subject: 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 --- src/gpg-error.vers | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gpg-error.vers') diff --git a/src/gpg-error.vers b/src/gpg-error.vers index 1105e80..cdef0cd 100644 --- a/src/gpg-error.vers +++ b/src/gpg-error.vers @@ -179,6 +179,11 @@ GPG_ERROR_1.0 { # gpgrt_kill_process; # gpgrt_release_process; + gpgrt_argparse; + gpgrt_strusage; + gpgrt_set_strusage; + gpgrt_set_usage_outfnc; + gpgrt_set_fixed_string_mapper; local: *; -- cgit v1.2.1