diff options
author | Werner Koch <wk@gnupg.org> | 2013-10-16 16:20:56 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-10-16 16:20:56 +0200 |
commit | a329b6abf00c990faf1986f9fbad7b4d71c13bcb (patch) | |
tree | 52b1f995cbc863404fb8a01005f3d17c29706655 /src/gcrypt.h.in | |
parent | 45aa6131e93fac89d46733b3436d960f35fb99b2 (diff) | |
download | libgcrypt-a329b6abf00c990faf1986f9fbad7b4d71c13bcb.tar.gz |
sexp: Add function gcry_sexp_extract_param.
* src/gcrypt.h.in (_GCRY_GCC_ATTR_SENTINEL): New.
(gcry_sexp_extract_param): New.
* src/visibility.c (gcry_sexp_extract_param): New.
* src/visibility.h (gcry_sexp_extract_param): Add hack to detect
internal use.
* cipher/pubkey-util.c (_gcry_pk_util_extract_mpis): Move and split
into ...
* src/sexp.c (_gcry_sexp_vextract_param)
(_gcry_sexp_extract_param): this. Change all callers. Add support for buffer
descriptors and a path option/
* tests/tsexp.c (die, hex2buffer, hex2mpi, hex2mpiopa): New.
(cmp_mpihex, cmp_bufhex): New.
(check_extract_param): New.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gcrypt.h.in')
-rw-r--r-- | src/gcrypt.h.in | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index 8646f43d..64cc0e4e 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -102,6 +102,10 @@ extern "C" { #define _GCRY_GCC_ATTR_PRINTF(f,a) __attribute__ ((format (printf,f,a))) +#if _GCRT_GCC_VERSION >= 40000 +#define _GCRY_GCC_ATTR_SENTINEL(a) __attribute__ ((sentinel(a))) +#endif + #endif /*__GNUC__*/ #ifndef _GCRY_GCC_ATTR_DEPRECATED @@ -114,7 +118,10 @@ extern "C" { #define _GCRY_GCC_ATTR_MALLOC #endif #ifndef _GCRY_GCC_ATTR_PRINTF -#define _GCRY_GCC_ATTR_PRINTF +#define _GCRY_GCC_ATTR_PRINTF(f,a) +#endif +#ifndef _GCRY_GCC_ATTR_SENTINEL +#define _GCRY_GCC_ATTR_SENTINEL(a) #endif /* Make up an attribute to mark functions and types as deprecated but @@ -459,6 +466,12 @@ char *gcry_sexp_nth_string (gcry_sexp_t list, int number); value can't be converted to an MPI, `NULL' is returned. */ gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt); +/* Convenience fucntion to extract parameters from an S-expression + * using a list of single letter parameters. */ +gpg_error_t gcry_sexp_extract_param (gcry_sexp_t sexp, + const char *path, + const char *list, + ...) _GCRY_GCC_ATTR_SENTINEL(0); /******************************************* |