From 3e8be4c4f824a09df14734ac4ccb9bcc5b2535d2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 2 Aug 2021 11:27:16 +0200 Subject: -doxygen fixes --- contrib/gana | 2 +- .../anastasis_authorization_plugin_email.c | 2 +- .../anastasis_authorization_plugin_file.c | 2 +- .../anastasis_authorization_plugin_post.c | 2 +- .../anastasis_authorization_plugin_sms.c | 2 +- src/backend/anastasis-httpd.c | 2 +- src/backend/anastasis-httpd.h | 2 +- src/include/anastasis_crypto_lib.h | 6 +- src/include/anastasis_json.h | 4 +- src/include/anastasis_testing_lib.h | 46 ++-- src/include/gettext.h | 302 ++++++++++++++++++--- src/include/platform.h | 2 +- src/reducer/anastasis_api_backup_redux.c | 2 +- src/reducer/anastasis_api_recovery_redux.c | 2 +- src/reducer/anastasis_api_redux.c | 2 +- src/reducer/anastasis_api_redux.h | 2 +- src/reducer/validation_CH_AHV.c | 2 +- src/reducer/validation_CZ_BN.c | 2 +- src/reducer/validation_DE_SVN.c | 2 +- src/reducer/validation_DE_TIN.c | 2 +- src/reducer/validation_IN_AADHAR.c | 2 +- src/reducer/validation_IT_CF.c | 2 +- src/reducer/validation_XX_SQUARE.c | 2 +- src/reducer/validation_XY_PRIME.c | 2 +- src/restclient/anastasis_api_config.c | 2 +- src/restclient/anastasis_api_curl_defaults.c | 2 +- src/restclient/anastasis_api_curl_defaults.h | 2 +- src/restclient/anastasis_api_keyshare_lookup.c | 2 +- src/restclient/anastasis_api_policy_lookup.c | 2 +- src/restclient/anastasis_api_policy_store.c | 2 +- src/restclient/anastasis_api_truth_store.c | 2 +- src/stasis/anastasis-dbinit.c | 4 +- src/stasis/anastasis_db_plugin.c | 2 +- src/stasis/plugin_anastasis_postgres.c | 2 +- src/testing/testing_api_trait_salt.c | 24 +- src/testing/testing_api_trait_truth_uuid.c | 29 +- src/testing/testing_cmd_challenge_answer.c | 2 +- src/testing/testing_cmd_policy_create.c | 2 +- src/testing/testing_cmd_recover_secret.c | 14 +- src/testing/testing_cmd_secret_share.c | 2 +- src/testing/testing_cmd_truth_upload.c | 2 +- src/testing/testing_trait_challenge.c | 21 +- src/testing/testing_trait_core_secret.c | 21 +- src/testing/testing_trait_policy.c | 21 +- src/testing/testing_trait_truth.c | 21 +- src/util/anastasis_crypto.c | 8 +- 46 files changed, 372 insertions(+), 215 deletions(-) diff --git a/contrib/gana b/contrib/gana index 755e752..0f1eb85 160000 --- a/contrib/gana +++ b/contrib/gana @@ -1 +1 @@ -Subproject commit 755e752e3a235df0be8d45374835b109f7843c1c +Subproject commit 0f1eb8555b89056fe62e093211e53a1f9ba85d56 diff --git a/src/authorization/anastasis_authorization_plugin_email.c b/src/authorization/anastasis_authorization_plugin_email.c index 5448b7d..3e13625 100644 --- a/src/authorization/anastasis_authorization_plugin_email.c +++ b/src/authorization/anastasis_authorization_plugin_email.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file include/anastasis_authorization_plugin_email.c + * @file anastasis_authorization_plugin_email.c * @brief authorization plugin email based * @author Dominik Meister */ diff --git a/src/authorization/anastasis_authorization_plugin_file.c b/src/authorization/anastasis_authorization_plugin_file.c index 15c22a1..9b18d38 100644 --- a/src/authorization/anastasis_authorization_plugin_file.c +++ b/src/authorization/anastasis_authorization_plugin_file.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file include/anastasis_authorization_plugin_file.c + * @file anastasis_authorization_plugin_file.c * @brief authorization plugin file based for testing * @author Dominik Meister */ diff --git a/src/authorization/anastasis_authorization_plugin_post.c b/src/authorization/anastasis_authorization_plugin_post.c index 1240316..8fa5979 100644 --- a/src/authorization/anastasis_authorization_plugin_post.c +++ b/src/authorization/anastasis_authorization_plugin_post.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file include/anastasis_authorization_plugin_post.c + * @file anastasis_authorization_plugin_post.c * @brief authorization plugin post based * @author Christian Grothoff */ diff --git a/src/authorization/anastasis_authorization_plugin_sms.c b/src/authorization/anastasis_authorization_plugin_sms.c index 0cd36c5..6421884 100644 --- a/src/authorization/anastasis_authorization_plugin_sms.c +++ b/src/authorization/anastasis_authorization_plugin_sms.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file include/anastasis_authorization_plugin_email.c + * @file anastasis_authorization_plugin_sms.c * @brief authorization plugin email based * @author Dominik Meister */ diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c index 56bd7c9..ee7aea7 100644 --- a/src/backend/anastasis-httpd.c +++ b/src/backend/anastasis-httpd.c @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see */ /** - * @file backup/anastasis-httpd.c + * @file backend/anastasis-httpd.c * @brief HTTP serving layer intended to provide basic backup operations * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/backend/anastasis-httpd.h b/src/backend/anastasis-httpd.h index 6fe0023..8628f86 100644 --- a/src/backend/anastasis-httpd.h +++ b/src/backend/anastasis-httpd.h @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see */ /** - * @file anastasis/anastasis-httpd.h + * @file backend/anastasis-httpd.h * @brief HTTP serving layer * @author Christian Grothoff */ diff --git a/src/include/anastasis_crypto_lib.h b/src/include/anastasis_crypto_lib.h index bf29b27..ee3ef16 100644 --- a/src/include/anastasis_crypto_lib.h +++ b/src/include/anastasis_crypto_lib.h @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_cryto_lib.h + * @file include/anastasis_crypto_lib.h * @brief anastasis crypto api * @author Christian Grothoff * @author Dominik Meister @@ -370,7 +370,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt ( * are the first 48Byte of the data. * * @param id Hashed User input, used for the generation of the encryption key - * @param enc_rec_doc, contains the encrypted recovery document and the nonce and iv used for the encryption. + * @param enc_rec_doc contains the encrypted recovery document and the nonce and iv used for the encryption. * @param erd_size size of the data * @param[out] rec_doc return from the result, which contains the encrypted recovery document * and the nonce and iv used for the encryption as Additional Data @@ -464,7 +464,7 @@ ANASTASIS_CRYPTO_truth_decrypt ( * A key share is randomly generated, one key share is generated for every * truth a policy contains. * - * @param key_share[out] reference to the created key share. + * @param[out] key_share reference to the created key share. */ void ANASTASIS_CRYPTO_keyshare_create ( diff --git a/src/include/anastasis_json.h b/src/include/anastasis_json.h index 9e8d924..d2523a2 100644 --- a/src/include/anastasis_json.h +++ b/src/include/anastasis_json.h @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_json.h + * @file include/anastasis_json.h * @brief anastasis de-/serialization api * @author Christian Grothoff * @author Dominik Meister @@ -407,4 +407,4 @@ ANASTASIS_apply_anastasis_recovery_action ( struct ANASTASIS_RecoveryAction *ra, ANASTASIS_RecoveryApplyActionCallback cb); -#endif /* _ANASTASIS_JSON_H */ \ No newline at end of file +#endif /* _ANASTASIS_JSON_H */ diff --git a/src/include/anastasis_testing_lib.h b/src/include/anastasis_testing_lib.h index a54e3ae..80018d9 100644 --- a/src/include/anastasis_testing_lib.h +++ b/src/include/anastasis_testing_lib.h @@ -62,7 +62,7 @@ ANASTASIS_TESTING_get_trait_hash (const struct TALER_TESTING_Command *cmd, * * @param index the number's index number. * @param h the hash to offer. - * @return #GNUNET_OK on success. + * @return trait on success. */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_hash (unsigned int index, @@ -89,7 +89,7 @@ ANASTASIS_TESTING_get_trait_truth_key ( * * @param index usually zero * @param h the account_pub to offer. - * @return #GNUNET_OK on success. + * @return trait on success. */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_truth_key ( @@ -118,7 +118,7 @@ ANASTASIS_TESTING_get_trait_account_pub ( * * @param index usually zero * @param h the account_pub to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_account_pub ( @@ -147,7 +147,7 @@ ANASTASIS_TESTING_get_trait_account_priv ( * * @param index usually zero * @param priv the account_priv to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_account_priv ( @@ -175,7 +175,7 @@ ANASTASIS_TESTING_get_trait_payment_secret ( * * @param index usually zero * @param h the payment secret to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_payment_secret ( @@ -188,27 +188,27 @@ ANASTASIS_TESTING_make_trait_payment_secret ( * * @param cmd command to extract the number from. * @param index the number's index number. - * @param[out] uuid set to the number coming from @a cmd. + * @param[out] tpk set to the number coming from @a cmd. * @return #GNUNET_OK on success. */ int ANASTASIS_TESTING_get_trait_truth_uuid ( const struct TALER_TESTING_Command *cmd, unsigned int index, - const struct ANASTASIS_CRYPTO_TruthUUIDP **uuid); + const struct ANASTASIS_CRYPTO_TruthUUIDP **tpk); /** * Offer a truth UUID. * * @param index the number's index number. - * @param uuid the UUID to offer. - * @return #GNUNET_OK on success. + * @param tpk the UUID to offer. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_truth_uuid ( unsigned int index, - const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid); + const struct ANASTASIS_CRYPTO_TruthUUIDP *tpk); /** @@ -231,7 +231,7 @@ ANASTASIS_TESTING_get_trait_eks ( * * @param index the number's index number. * @param eks the encrypted key share to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_eks ( @@ -259,7 +259,7 @@ ANASTASIS_TESTING_get_trait_code ( * * @param index the number's index number. * @param tpk the public key to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_code (unsigned int index, @@ -515,8 +515,8 @@ ANASTASIS_TESTING_get_trait_salt ( * Offer an salt. * * @param index the salt's index number. - * @param u the salt to offer. - * @return #GNUNET_OK on success. + * @param s the salt to offer. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_salt ( @@ -559,7 +559,7 @@ ANASTASIS_TESTING_get_trait_truth (const struct TALER_TESTING_Command *cmd, * * @param index the truth's index number. * @param t the truth to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_truth (unsigned int index, @@ -617,7 +617,7 @@ ANASTASIS_TESTING_cmd_truth_upload ( * @param answer the answer to the security question * @param http_status expected HTTP status * @param tso truth upload options - * @param upload_ref reference to the previous upload + * @param salt_ref reference to command downloading provider salt * @return the command */ struct TALER_TESTING_Command @@ -652,8 +652,8 @@ ANASTASIS_TESTING_get_trait_policy (const struct TALER_TESTING_Command *cmd, * Offer a policy. * * @param index the policy's index number. - * @param t the policy to offer. - * @return #GNUNET_OK on success. + * @param p the policy to offer. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_policy (unsigned int index, @@ -694,7 +694,7 @@ ANASTASIS_TESTING_get_trait_core_secret (const struct * * @param index the core secret's index number (usually 0). * @param s the core secret to offer. - * @return #GNUNET_OK on success. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_core_secret (unsigned int index, @@ -785,6 +785,8 @@ enum ANASTASIS_TESTING_RecoverSecretOption * @param version of the recovery document to download * @param rso recover secret options * @param download_ref salt download reference + * @param core_secret_ref reference to core secret + * we expect to recover * @return the command */ struct TALER_TESTING_Command @@ -831,8 +833,8 @@ ANASTASIS_TESTING_get_trait_challenge (const struct TALER_TESTING_Command *cmd, * Offer a challenge. * * @param index the challenge index number. - * @param c the challenge to offer. - * @return #GNUNET_OK on success. + * @param r the challenge to offer. + * @return trait on success */ struct TALER_TESTING_Trait ANASTASIS_TESTING_make_trait_challenge (unsigned int index, @@ -867,6 +869,8 @@ ANASTASIS_TESTING_cmd_challenge_start ( * @param challenge_ref reference to the recovery process * @param challenge_index defines the index of the trait to solve * @param answer to the challenge + * @param mode 0 for no plugin needed (security question) + * 1 for plugin needed to authenticate * @param expected_cs expected reply type * @return the command */ diff --git a/src/include/gettext.h b/src/include/gettext.h index 4585126..705487b 100644 --- a/src/include/gettext.h +++ b/src/include/gettext.h @@ -1,29 +1,40 @@ /* Convenience header for conditional use of GNU . - Copyright Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software + Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 3, or (at your option) - any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS +/* NLS can be disabled through the configure --disable-nls option + or through "#define ENABLE NLS 0" before including this file. */ +#if defined ENABLE_NLS && ENABLE_NLS /* Get declarations of GNU message catalog functions. */ -#include +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif #else @@ -32,9 +43,19 @@ later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas - is GNUNET_OK. */ + is OK. */ #if defined(__sun) -#include +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2 && ! defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif #endif /* Disabled NLS. @@ -42,21 +63,39 @@ for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ -#define gettext(Msgid) ((const char *) (Msgid)) -#define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -#define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -#define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -#define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -/* slight modification here to avoid warnings: generate GNUNET_NO code, - not even the cast... */ -#define textdomain(Domainname) -#define bindtextdomain(Domainname, Dirname) -#define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) +# undef gettext +# define gettext(Msgid) ((const char *) (Msgid)) +# undef dgettext +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# undef dcgettext +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# undef dngettext +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# undef dcngettext +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) +# undef textdomain +# define textdomain(Domainname) ((const char *) (Domainname)) +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# undef bind_textdomain_codeset +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif +/* Prefer gnulib's setlocale override over libintl's setlocale override. */ +#ifdef GNULIB_defined_setlocale +# undef setlocale +# define setlocale rpl_setlocale #endif /* A pseudo function call that serves as a marker for the automated @@ -68,4 +107,205 @@ initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, \ + N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if ((translation == msg_ctxt_id) || (translation == msgid_plural)) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include + +/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported. + This relates to the -Wvla and -Wvla-larger-than warnings, enabled in + the default GCC many warnings set. This allows programs to disable use + of VLAs, which may be unintended, or may be awkward to support portably, + or may have security implications due to non-deterministic stack usage. */ + +#if (! defined GNULIB_NO_VLA \ + && (((__GNUC__ >= 3 || __GNUG__ >= 2) && ! defined __STRICT_ANSI__) \ + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) + || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */)) +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 +#else +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 +#endif + +#if ! _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); +#if ! _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return msgid; +} + + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = ! (translation == msg_ctxt_id || translation == + msgid_plural); +#if ! _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + + #endif /* _LIBGETTEXT_H */ diff --git a/src/include/platform.h b/src/include/platform.h index 04a2dce..d4b8bbe 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -15,7 +15,7 @@ */ /** - * @file include/platform.h + * @file anastasis/src/include/platform.h * @brief This file contains the includes and definitions which are used by the * rest of the modules * @author Sree Harsha Totakura diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c index 02e2401..2f44688 100644 --- a/src/reducer/anastasis_api_backup_redux.c +++ b/src/reducer/anastasis_api_backup_redux.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_backup_redux.c + * @file reducer/anastasis_api_backup_redux.c * @brief anastasis reducer backup api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c index c0fae18..0d395bc 100644 --- a/src/reducer/anastasis_api_recovery_redux.c +++ b/src/reducer/anastasis_api_recovery_redux.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_recovery_redux.c + * @file reducer/anastasis_api_recovery_redux.c * @brief anastasis reducer recovery api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c index 4246682..41b3fd7 100644 --- a/src/reducer/anastasis_api_redux.c +++ b/src/reducer/anastasis_api_redux.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_redux.c + * @file reducer/anastasis_api_redux.c * @brief anastasis reducer api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/anastasis_api_redux.h b/src/reducer/anastasis_api_redux.h index 19d9466..b388fd3 100644 --- a/src/reducer/anastasis_api_redux.h +++ b/src/reducer/anastasis_api_redux.h @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/anastasis_api_redux.h + * @file reducer/anastasis_api_redux.h * @brief anastasis reducer api, internal data structures * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/validation_CH_AHV.c b/src/reducer/validation_CH_AHV.c index e6a2f25..5bf6fb3 100644 --- a/src/reducer/validation_CH_AHV.c +++ b/src/reducer/validation_CH_AHV.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_CH_AHV.c + * @file reducer/validation_CH_AHV.c * @brief anastasis reducer api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/validation_CZ_BN.c b/src/reducer/validation_CZ_BN.c index 4598c42..05df7d4 100644 --- a/src/reducer/validation_CZ_BN.c +++ b/src/reducer/validation_CZ_BN.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_CZ_BN.c + * @file reducer/validation_CZ_BN.c * @brief validation of Czeck Birth Numbers * @author Christian Grothoff */ diff --git a/src/reducer/validation_DE_SVN.c b/src/reducer/validation_DE_SVN.c index bfc406d..0bfe02e 100644 --- a/src/reducer/validation_DE_SVN.c +++ b/src/reducer/validation_DE_SVN.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_DE_SVN.c + * @file reducer/validation_DE_SVN.c * @brief * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/validation_DE_TIN.c b/src/reducer/validation_DE_TIN.c index 9c97365..a930be3 100644 --- a/src/reducer/validation_DE_TIN.c +++ b/src/reducer/validation_DE_TIN.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_DE_TIN.c + * @file reducer/validation_DE_TIN.c * @brief validation logic for German taxpayer identification numbers * @author Christian Grothoff */ diff --git a/src/reducer/validation_IN_AADHAR.c b/src/reducer/validation_IN_AADHAR.c index 939ee72..ee38f3f 100644 --- a/src/reducer/validation_IN_AADHAR.c +++ b/src/reducer/validation_IN_AADHAR.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_IN_AADHAR.c + * @file reducer/validation_IN_AADHAR.c * @brief validation logic for Indian Aadhar numbers * @author Christian Grothoff */ diff --git a/src/reducer/validation_IT_CF.c b/src/reducer/validation_IT_CF.c index ecdad90..7eaa325 100644 --- a/src/reducer/validation_IT_CF.c +++ b/src/reducer/validation_IT_CF.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_IT_CF.c + * @file reducer/validation_IT_CF.c * @brief validation of Italian Code Fiscales * @author Christian Grothoff */ diff --git a/src/reducer/validation_XX_SQUARE.c b/src/reducer/validation_XX_SQUARE.c index fa3ebfb..83bad45 100644 --- a/src/reducer/validation_XX_SQUARE.c +++ b/src/reducer/validation_XX_SQUARE.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_XX_PRIME.c + * @file reducer/validation_XX_SQUARE.c * @brief anastasis reducer api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/reducer/validation_XY_PRIME.c b/src/reducer/validation_XY_PRIME.c index ab24014..640e588 100644 --- a/src/reducer/validation_XY_PRIME.c +++ b/src/reducer/validation_XY_PRIME.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file redux/validation_XY_PRIME.c + * @file reducer/validation_XY_PRIME.c * @brief anastasis reducer api * @author Christian Grothoff * @author Dominik Meister diff --git a/src/restclient/anastasis_api_config.c b/src/restclient/anastasis_api_config.c index 8a479f4..845b7f6 100644 --- a/src/restclient/anastasis_api_config.c +++ b/src/restclient/anastasis_api_config.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_config.c + * @file restclient/anastasis_api_config.c * @brief Implementation of the /config GET * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/restclient/anastasis_api_curl_defaults.c b/src/restclient/anastasis_api_curl_defaults.c index 27b965f..70d015f 100644 --- a/src/restclient/anastasis_api_curl_defaults.c +++ b/src/restclient/anastasis_api_curl_defaults.c @@ -15,7 +15,7 @@ */ /** - * @file lib/anastasis_api_curl_defaults.c + * @file restclient/anastasis_api_curl_defaults.c * @brief curl easy handle defaults * @author Florian Dold */ diff --git a/src/restclient/anastasis_api_curl_defaults.h b/src/restclient/anastasis_api_curl_defaults.h index 62e0081..1ba139f 100644 --- a/src/restclient/anastasis_api_curl_defaults.h +++ b/src/restclient/anastasis_api_curl_defaults.h @@ -15,7 +15,7 @@ */ /** - * @file lib/anastasis_api_curl_defaults.h + * @file restclient/anastasis_api_curl_defaults.h * @brief curl easy handle defaults * @author Florian Dold */ diff --git a/src/restclient/anastasis_api_keyshare_lookup.c b/src/restclient/anastasis_api_keyshare_lookup.c index a2e4316..b61fe20 100644 --- a/src/restclient/anastasis_api_keyshare_lookup.c +++ b/src/restclient/anastasis_api_keyshare_lookup.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_keyshare_lookup.c + * @file restclient/anastasis_api_keyshare_lookup.c * @brief Implementation of the GET /truth client * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/restclient/anastasis_api_policy_lookup.c b/src/restclient/anastasis_api_policy_lookup.c index e7c6e33..cff4d68 100644 --- a/src/restclient/anastasis_api_policy_lookup.c +++ b/src/restclient/anastasis_api_policy_lookup.c @@ -18,7 +18,7 @@ */ /** - * @file lib/anastasis_api_policy_lookup.c + * @file restclient/anastasis_api_policy_lookup.c * @brief Implementation of the /policy GET and POST * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/restclient/anastasis_api_policy_store.c b/src/restclient/anastasis_api_policy_store.c index 7c6c244..5d44094 100644 --- a/src/restclient/anastasis_api_policy_store.c +++ b/src/restclient/anastasis_api_policy_store.c @@ -18,7 +18,7 @@ */ /** - * @file lib/anastasis_api_policy_store.c + * @file restclient/anastasis_api_policy_store.c * @brief Implementation of the /policy GET and POST * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/restclient/anastasis_api_truth_store.c b/src/restclient/anastasis_api_truth_store.c index 3311bc4..d765e3f 100644 --- a/src/restclient/anastasis_api_truth_store.c +++ b/src/restclient/anastasis_api_truth_store.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file lib/anastasis_api_truth_store.c + * @file restclient/anastasis_api_truth_store.c * @brief Implementation of the /truth GET and POST * @author Christian Grothoff * @author Dennis Neufeld diff --git a/src/stasis/anastasis-dbinit.c b/src/stasis/anastasis-dbinit.c index 5c0a174..36a5f41 100644 --- a/src/stasis/anastasis-dbinit.c +++ b/src/stasis/anastasis-dbinit.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014, 2015 GNUnet e.V. + Copyright (C) 2019-2021 SARL TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see */ /** - * @file util/anastasis-dbinit.c + * @file stasis/anastasis-dbinit.c * @brief Create tables for the merchant database. * @author Dennis Neufeld * @author Dominik Meister diff --git a/src/stasis/anastasis_db_plugin.c b/src/stasis/anastasis_db_plugin.c index 6b5332c..6d258b5 100644 --- a/src/stasis/anastasis_db_plugin.c +++ b/src/stasis/anastasis_db_plugin.c @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see */ /** - * @file merchantdb/merchantdb_plugin.c + * @file stasis/anastasis_db_plugin.c * @brief Logic to load database plugin * @author Christian Grothoff * @author Sree Harsha Totakura diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 4d95c8f..0ece276 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -14,7 +14,7 @@ Anastasis; see the file COPYING.GPL. If not, see */ /** - * @file anastasis/plugin_anastasisdb_postgres.c + * @file stasis/plugin_anastasis_postgres.c * @brief database helper functions for postgres used by the anastasis * @author Sree Harsha Totakura * @author Christian Grothoff diff --git a/src/testing/testing_api_trait_salt.c b/src/testing/testing_api_trait_salt.c index 116742f..c4ceb55 100644 --- a/src/testing/testing_api_trait_salt.c +++ b/src/testing/testing_api_trait_salt.c @@ -29,17 +29,9 @@ #define ANASTASIS_TESTING_TRAIT_SALT "anastasis-provider-salt" -/** - * Obtain a salt from @a cmd. - * - * @param cmd command to extract the salt from. - * @param index the salt's index number. - * @param s[out] set to the salt coming from @a cmd. - * @return #GNUNET_OK on success. - */ int -ANASTASIS_TESTING_get_trait_salt - (const struct TALER_TESTING_Command *cmd, +ANASTASIS_TESTING_get_trait_salt ( + const struct TALER_TESTING_Command *cmd, unsigned int index, const struct ANASTASIS_CRYPTO_ProviderSaltP **s) { @@ -50,16 +42,9 @@ ANASTASIS_TESTING_get_trait_salt } -/** - * Offer an salt. - * - * @param index the salt's index number. - * @param u the salt to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_salt - (unsigned int index, +ANASTASIS_TESTING_make_trait_salt ( + unsigned int index, const struct ANASTASIS_CRYPTO_ProviderSaltP *s) { struct TALER_TESTING_Trait ret = { @@ -67,6 +52,7 @@ ANASTASIS_TESTING_make_trait_salt .trait_name = ANASTASIS_TESTING_TRAIT_SALT, .ptr = (const void *) s }; + return ret; } diff --git a/src/testing/testing_api_trait_truth_uuid.c b/src/testing/testing_api_trait_truth_uuid.c index 38a7336..6c171fd 100644 --- a/src/testing/testing_api_trait_truth_uuid.c +++ b/src/testing/testing_api_trait_truth_uuid.c @@ -17,7 +17,7 @@ */ /** - * @file lib/testing_api_trait_truth_pub.c + * @file lib/testing_api_trait_truth_uuid.c * @brief traits to offer a UUID for some truth * @author Christian Grothoff * @author Dominik Meister @@ -26,20 +26,13 @@ #include "platform.h" #include "anastasis_testing_lib.h" + #define ANASTASIS_TESTING_TRAIT_TRUTH_UUID "anastasis-truth-uuid" -/** - * Obtain an public key from @a cmd. - * - * @param cmd command to extract the number from. - * @param index the number's index number. - * @param u[out] set to the number coming from @a cmd. - * @return #GNUNET_OK on success. - */ int -ANASTASIS_TESTING_get_trait_truth_uuid - (const struct TALER_TESTING_Command *cmd, +ANASTASIS_TESTING_get_trait_truth_uuid ( + const struct TALER_TESTING_Command *cmd, unsigned int index, const struct ANASTASIS_CRYPTO_TruthUUIDP **tpk) { @@ -50,16 +43,9 @@ ANASTASIS_TESTING_get_trait_truth_uuid } -/** - * Offer a truth public key. - * - * @param index the number's index number. - * @param tpk the public key to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_truth_uuid - (unsigned int index, +ANASTASIS_TESTING_make_trait_truth_uuid ( + unsigned int index, const struct ANASTASIS_CRYPTO_TruthUUIDP *tpk) { struct TALER_TESTING_Trait ret = { @@ -67,8 +53,9 @@ ANASTASIS_TESTING_make_trait_truth_uuid .trait_name = ANASTASIS_TESTING_TRAIT_TRUTH_UUID, .ptr = (const void *) tpk }; + return ret; } -/* end of testing_api_trait_truth_pub.c */ +/* end of testing_api_trait_truth_uuid.c */ diff --git a/src/testing/testing_cmd_challenge_answer.c b/src/testing/testing_cmd_challenge_answer.c index b243d61..bca7d6b 100644 --- a/src/testing/testing_cmd_challenge_answer.c +++ b/src/testing/testing_cmd_challenge_answer.c @@ -488,7 +488,7 @@ challenge_cleanup (void *cls, * Offer internal data to other commands. * * @param cls closure - * @param ret[out] result (could be anything) + * @param[out] ret result (could be anything) * @param trait name of the trait * @param index index number of the object to extract. * @return #GNUNET_OK on success diff --git a/src/testing/testing_cmd_policy_create.c b/src/testing/testing_cmd_policy_create.c index fc9ed44..964fb91 100644 --- a/src/testing/testing_cmd_policy_create.c +++ b/src/testing/testing_cmd_policy_create.c @@ -146,7 +146,7 @@ policy_create_cleanup (void *cls, * Offer internal data to other commands. * * @param cls closure - * @param ret[out] result (could be anything) + * @param[out] ret result (could be anything) * @param trait name of the trait * @param index index number of the object to extract. * @return #GNUNET_OK on success diff --git a/src/testing/testing_cmd_recover_secret.c b/src/testing/testing_cmd_recover_secret.c index a95bdd2..6fc3861 100644 --- a/src/testing/testing_cmd_recover_secret.c +++ b/src/testing/testing_cmd_recover_secret.c @@ -47,12 +47,12 @@ struct RecoverSecretState struct ANASTASIS_Recovery *recovery; /** - * Reference to download command we expect to lookup. + * Reference to download command we expect to look up. */ const char *download_reference; /** - * Reference to download command we expect to lookup. + * Reference to core secret share we expect to look up. */ const char *core_secret_reference; @@ -129,7 +129,7 @@ policy_lookup_cb (void *cls, * On success, the secret is returned in @a secret. * * @param cls closure - * @param ec error code + * @param rc error code * @param secret contains the core secret which is passed to the user * @param secret_size defines the size of the core secret */ @@ -214,9 +214,9 @@ recover_secret_run (void *cls, } if (NULL != rss->core_secret_reference) { - ref = TALER_TESTING_interpreter_lookup_command - (is, - rss->core_secret_reference); + ref = TALER_TESTING_interpreter_lookup_command ( + is, + rss->core_secret_reference); if (NULL == ref) { GNUNET_break (0); @@ -302,7 +302,7 @@ recover_secret_cleanup (void *cls, * Offer internal data to other commands. * * @param cls closure - * @param ret[out] result (could be anything) + * @param[out] ret result (could be anything) * @param trait name of the trait * @param index index number of the object to extract. * @return #GNUNET_OK on success diff --git a/src/testing/testing_cmd_secret_share.c b/src/testing/testing_cmd_secret_share.c index b80006e..cecfd86 100644 --- a/src/testing/testing_cmd_secret_share.c +++ b/src/testing/testing_cmd_secret_share.c @@ -355,7 +355,7 @@ secret_share_cleanup (void *cls, * Offer internal data to other commands. * * @param cls closure - * @param ret[out] result (could be anything) + * @param[out] ret result (could be anything) * @param trait name of the trait * @param index index number of the object to extract. * @return #GNUNET_OK on success diff --git a/src/testing/testing_cmd_truth_upload.c b/src/testing/testing_cmd_truth_upload.c index a9a3161..87dec9d 100644 --- a/src/testing/testing_cmd_truth_upload.c +++ b/src/testing/testing_cmd_truth_upload.c @@ -272,7 +272,7 @@ truth_upload_cleanup (void *cls, * Offer internal data to other commands. * * @param cls closure - * @param ret[out] result (could be anything) + * @param[out] ret result (could be anything) * @param trait name of the trait * @param index index number of the object to extract. * @return #GNUNET_OK on success diff --git a/src/testing/testing_trait_challenge.c b/src/testing/testing_trait_challenge.c index 5c40d8e..da981d7 100644 --- a/src/testing/testing_trait_challenge.c +++ b/src/testing/testing_trait_challenge.c @@ -28,14 +28,7 @@ #define ANASTASIS_TESTING_TRAIT_CHALLENGE "anastasis-challenge" -/** - * Obtain a challenge from @a cmd. - * - * @param cmd command to extract the challenge from. - * @param index the index of the challenge - * @param c[out] set to the challenge coming from @a cmd. - * @return #GNUNET_OK on success. - */ + int ANASTASIS_TESTING_get_trait_challenge (const struct TALER_TESTING_Command *cmd, unsigned int index, @@ -48,17 +41,9 @@ ANASTASIS_TESTING_get_trait_challenge (const struct TALER_TESTING_Command *cmd, } -/** - * Offer a challenge. - * - * @param index the challenge index number. - * @param c the challenge to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_challenge - (unsigned int index, - const struct ANASTASIS_Challenge *c) +ANASTASIS_TESTING_make_trait_challenge (unsigned int index, + const struct ANASTASIS_Challenge *c) { struct TALER_TESTING_Trait ret = { .index = index, diff --git a/src/testing/testing_trait_core_secret.c b/src/testing/testing_trait_core_secret.c index 100a249..98eb0db 100644 --- a/src/testing/testing_trait_core_secret.c +++ b/src/testing/testing_trait_core_secret.c @@ -29,14 +29,6 @@ #define ANASTASIS_TESTING_TRAIT_CORE_SECRET "anastasis-core-secret" -/** - * Obtain the core secret from @a cmd. - * - * @param cmd command to extract the core secret from. - * @param index the index of the core secret (usually 0) - * @param s[out] set to the core secret coming from @a cmd. - * @return #GNUNET_OK on success. - */ int ANASTASIS_TESTING_get_trait_core_secret (const struct TALER_TESTING_Command *cmd, @@ -50,23 +42,16 @@ ANASTASIS_TESTING_get_trait_core_secret (const struct } -/** - * Offer the core secret. - * - * @param index the core secret's index number (usually 0). - * @param s the core secret to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_core_secret - (unsigned int index, - const void *s) +ANASTASIS_TESTING_make_trait_core_secret (unsigned int index, + const void *s) { struct TALER_TESTING_Trait ret = { .index = index, .trait_name = ANASTASIS_TESTING_TRAIT_CORE_SECRET, .ptr = s }; + return ret; } diff --git a/src/testing/testing_trait_policy.c b/src/testing/testing_trait_policy.c index 45e773c..1a6e572 100644 --- a/src/testing/testing_trait_policy.c +++ b/src/testing/testing_trait_policy.c @@ -29,14 +29,6 @@ #define ANASTASIS_TESTING_TRAIT_POLICY "anastasis-policy" -/** - * Obtain a policy from @a cmd. - * - * @param cmd command to extract the policy from. - * @param index the index of the policy - * @param t[out] set to the policy coming from @a cmd. - * @return #GNUNET_OK on success. - */ int ANASTASIS_TESTING_get_trait_policy (const struct TALER_TESTING_Command *cmd, unsigned int index, @@ -49,23 +41,16 @@ ANASTASIS_TESTING_get_trait_policy (const struct TALER_TESTING_Command *cmd, } -/** - * Offer a policy. - * - * @param index the policy's index number. - * @param t the policy to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_policy - (unsigned int index, - const struct ANASTASIS_Policy *p) +ANASTASIS_TESTING_make_trait_policy (unsigned int index, + const struct ANASTASIS_Policy *p) { struct TALER_TESTING_Trait ret = { .index = index, .trait_name = ANASTASIS_TESTING_TRAIT_POLICY, .ptr = (const void *) p }; + return ret; } diff --git a/src/testing/testing_trait_truth.c b/src/testing/testing_trait_truth.c index 51696e1..36b33d6 100644 --- a/src/testing/testing_trait_truth.c +++ b/src/testing/testing_trait_truth.c @@ -29,14 +29,6 @@ #define ANASTASIS_TESTING_TRAIT_TRUTH "anastasis-truth" -/** - * Obtain a truth from @a cmd. - * - * @param cmd command to extract the truth from. - * @param index the index of the truth - * @param t[out] set to the truth coming from @a cmd. - * @return #GNUNET_OK on success. - */ int ANASTASIS_TESTING_get_trait_truth (const struct TALER_TESTING_Command *cmd, unsigned int index, @@ -49,23 +41,16 @@ ANASTASIS_TESTING_get_trait_truth (const struct TALER_TESTING_Command *cmd, } -/** - * Offer a truth. - * - * @param index the truth's index number. - * @param t the truth to offer. - * @return #GNUNET_OK on success. - */ struct TALER_TESTING_Trait -ANASTASIS_TESTING_make_trait_truth - (unsigned int index, - const struct ANASTASIS_Truth *t) +ANASTASIS_TESTING_make_trait_truth (unsigned int index, + const struct ANASTASIS_Truth *t) { struct TALER_TESTING_Trait ret = { .index = index, .trait_name = ANASTASIS_TESTING_TRAIT_TRUTH, .ptr = (const void *) t }; + return ret; } diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c index ace0162..837cd88 100644 --- a/src/util/anastasis_crypto.c +++ b/src/util/anastasis_crypto.c @@ -136,8 +136,8 @@ get_iv_key (const void *key_material, * @param data data to encrypt * @param data_size size of the data * @param salt salt value which is used for key derivation - * @param res[out] ciphertext output - * @param res_size[out] size of the ciphertext + * @param[out] res ciphertext output + * @param[out] res_size size of the ciphertext */ static void anastasis_encrypt (const struct ANASTASIS_CRYPTO_NonceP *nonce, @@ -221,8 +221,8 @@ anastasis_encrypt (const struct ANASTASIS_CRYPTO_NonceP *nonce, * @param data data to decrypt * @param data_size size of the data * @param salt salt value which is used for key derivation - * @param res[out] plaintext output - * @param res_size[out] size of the plaintext + * @param[out] res plaintext output + * @param[out] res_size size of the plaintext */ static void anastasis_decrypt (const void *key, -- cgit v1.2.3