use more const in taler_testing_lib.h

This commit is contained in:
Christian Grothoff 2018-11-17 17:19:02 +01:00
parent cf1ce47863
commit e42f014cff
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
37 changed files with 134 additions and 117 deletions

View File

@ -310,6 +310,28 @@ deposit_confirmation_cleanup (void *cls,
}
/**
* Offer internal data to other commands.
*
* @param cls closure.
* @param ret[out] set to the wanted data.
* @param trait name of the trait.
* @param index index number of the traits to be returned.
*
* @return #GNUNET_OK on success
*/
static int
deposit_confirmation_traits (void *cls,
const void **ret,
const char *trait,
unsigned int index)
{
/* Must define this function because some callbacks
* look for certain traits on _all_ the commands. */
return GNUNET_SYSERR;
}
/**
* Create a "deposit-confirmation" command.
*
@ -346,7 +368,8 @@ TALER_TESTING_cmd_deposit_confirmation
cmd.label = label;
cmd.run = &deposit_confirmation_run;
cmd.cleanup = &deposit_confirmation_cleanup;
cmd.traits = &deposit_confirmation_traits;
return cmd;
}

View File

@ -114,12 +114,11 @@ auditor_cleanup (void *cls,
* @param ret[out] result
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
auditor_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -114,12 +114,11 @@ wire_auditor_cleanup (void *cls,
* @param ret[out] result
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
wire_auditor_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -116,6 +116,7 @@ struct History
*/
extern struct TALER_BANK_AuthenticationData AUTHS[];
/**
* Offer internal data to other commands.
*
@ -128,7 +129,7 @@ extern struct TALER_BANK_AuthenticationData AUTHS[];
*/
static int
history_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -166,7 +166,7 @@ reject_run (void *cls,
*/
static int
reject_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -196,12 +196,11 @@ check_bank_transfer_cleanup
* @param ret[out] result.
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
check_bank_transfer_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
@ -316,13 +315,14 @@ check_bank_empty_run (void *cls,
*/
static int
check_bank_empty_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
return GNUNET_SYSERR;
}
/**
* Checks wheter all the wire transfers got "checked"
* by the "bank check" CMD.

View File

@ -107,12 +107,11 @@ batch_cleanup (void *cls,
* @param ret[out] result.
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
batch_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -249,7 +249,7 @@ deposit_run (void *cls,
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
struct TALER_CoinSpendPublicKeyP coin_pub;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
struct TALER_DenominationSignature *denom_pub_sig;
const struct TALER_DenominationSignature *denom_pub_sig;
struct TALER_CoinSpendSignatureP coin_sig;
struct GNUNET_TIME_Absolute refund_deadline;
struct GNUNET_TIME_Absolute wire_deadline;
@ -443,7 +443,7 @@ deposit_cleanup (void *cls,
*/
static int
deposit_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -114,12 +114,11 @@ aggregator_cleanup (void *cls,
* @param ret[out] result.
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success
*/
static int
aggregator_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
@ -142,7 +141,6 @@ aggregator_traits (void *cls,
* @param label command label.
* @param config_filename configuration file for the
* aggregator to use.
*
* @return the command.
*/
struct TALER_TESTING_Command

View File

@ -183,7 +183,7 @@ auditor_sign_cleanup (void *cls,
*/
static int
auditor_sign_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -121,7 +121,7 @@ keyup_cleanup (void *cls,
*/
static int
keyup_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -115,12 +115,11 @@ wirewatch_cleanup (void *cls,
* @param ret[out] result.
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
wirewatch_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
@ -143,7 +142,6 @@ wirewatch_traits (void *cls,
*
* @param label command label.
* @param config_filename configuration filename.
*
* @return the command.
*/
struct TALER_TESTING_Command

View File

@ -259,7 +259,7 @@ fakebank_transfer_run (void *cls,
if (NULL != fts->reserve_reference)
{
const struct TALER_TESTING_Command *ref;
struct TALER_ReservePrivateKeyP *reserve_priv;
const struct TALER_ReservePrivateKeyP *reserve_priv;
ref = TALER_TESTING_interpreter_lookup_command
(is, fts->reserve_reference);
@ -414,12 +414,11 @@ fakebank_transfer_cleanup (void *cls,
* @param ret[out] result
* @param trait name of the trait.
* @param index index number of the object to offer.
*
* @return #GNUNET_OK on success.
*/
static int
fakebank_transfer_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -134,7 +134,7 @@ payback_cb (void *cls,
struct TALER_TESTING_Interpreter *is = ps->is;
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
const struct TALER_TESTING_Command *reserve_cmd;
struct TALER_ReservePrivateKeyP *reserve_priv;
const struct TALER_ReservePrivateKeyP *reserve_priv;
struct TALER_ReservePublicKeyP rp;
struct TALER_Amount expected_amount;
@ -225,9 +225,9 @@ payback_run (void *cls,
struct PaybackState *ps = cls;
const struct TALER_TESTING_Command *coin_cmd;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
struct TALER_DenominationBlindingKeyP *blinding_key;
const struct TALER_DenominationBlindingKeyP *blinding_key;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
struct TALER_DenominationSignature *coin_sig;
const struct TALER_DenominationSignature *coin_sig;
struct TALER_PlanchetSecretsP planchet;
ps->is = is;
@ -349,13 +349,12 @@ payback_cleanup (void *cls,
*/
static int
revoke_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
struct RevokeState *rs = cls;
struct TALER_TESTING_Trait traits[] = {
/* Needed by the handler which waits the proc'
* death and calls the next command */

View File

@ -533,7 +533,7 @@ link_cb (void *cls,
struct TALER_TESTING_Command *link_cmd
= &rls->is->commands[rls->is->ip];
unsigned int found;
unsigned int *num_fresh_coins;
const unsigned int *num_fresh_coins;
rls->rlh = NULL;
if (rls->expected_response_code != http_status)
@ -613,7 +613,7 @@ link_cb (void *cls,
found = 0;
/* Will point to the pointer inside the cmd state. */
struct FreshCoin *fc = NULL;
const struct FreshCoin *fc = NULL;
if (GNUNET_OK != TALER_TESTING_get_trait_fresh_coins
(reveal_cmd, 0, &fc))
@ -906,7 +906,7 @@ refresh_melt_run (void *cls,
const struct TALER_CoinSpendPrivateKeyP *melt_priv;
struct TALER_Amount melt_amount;
struct TALER_Amount fresh_amount;
struct TALER_DenominationSignature *melt_sig;
const struct TALER_DenominationSignature *melt_sig;
const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub;
const struct MeltDetails *md = &rms->melted_coin;
@ -1051,7 +1051,7 @@ refresh_melt_cleanup (void *cls,
*/
static int
refresh_melt_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
@ -1184,7 +1184,7 @@ TALER_TESTING_cmd_refresh_melt_with_retry (struct TALER_TESTING_Command cmd)
*/
static int
refresh_reveal_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -150,7 +150,7 @@ status_run (void *cls,
{
struct StatusState *ss = cls;
const struct TALER_TESTING_Command *create_reserve;
struct TALER_ReservePrivateKeyP *reserve_priv;
const struct TALER_ReservePrivateKeyP *reserve_priv;
struct TALER_ReservePublicKeyP reserve_pub;
ss->is = is;

View File

@ -219,7 +219,8 @@ deposit_wtid_cb
/* expected wire transfer subject line. */
const char *transfer_subject;
if (GNUNET_OK != TALER_TESTING_get_trait_transfer_subject
if (GNUNET_OK !=
TALER_TESTING_get_trait_transfer_subject
(bank_transfer_cmd, 0, &transfer_subject))
{
GNUNET_break (0);
@ -393,12 +394,11 @@ track_transaction_cleanup
*/
static int
track_transaction_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
struct TrackTransactionState *tts = cls;
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_wtid (0, &tts->wtid),
TALER_TESTING_trait_end ()
@ -410,6 +410,7 @@ track_transaction_traits (void *cls,
index);
}
/**
* Create a "track transaction" command.
*
@ -698,7 +699,7 @@ track_transfer_run (void *cls,
/* looking for a wtid to track .. */
struct TrackTransferState *tts = cls;
struct TALER_WireTransferIdentifierRawP wtid;
struct TALER_WireTransferIdentifierRawP *wtid_ptr;
const struct TALER_WireTransferIdentifierRawP *wtid_ptr;
/* If no reference is given, we'll use a all-zeros
* WTID */

View File

@ -245,7 +245,7 @@ withdraw_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct WithdrawState *ws = cls;
struct TALER_ReservePrivateKeyP *rp;
const struct TALER_ReservePrivateKeyP *rp;
const struct TALER_TESTING_Command *create_reserve;
(void) cmd;
@ -333,13 +333,13 @@ withdraw_cleanup (void *cls,
*/
static int
withdraw_traits (void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{
struct WithdrawState *ws = cls;
const struct TALER_TESTING_Command *reserve_cmd;
struct TALER_ReservePrivateKeyP *reserve_priv;
const struct TALER_ReservePrivateKeyP *reserve_priv;
/* We offer the reserve key where these coins were withdrawn
* from. */

View File

@ -368,6 +368,7 @@ maint_child_death (void *cls)
if (TALER_TESTING_cmd_is_batch (cmd))
{
struct TALER_TESTING_Command *batch_cmd;
GNUNET_assert
(GNUNET_OK == TALER_TESTING_get_trait_cmd
(cmd, 0, &batch_cmd)); /* bad? */

View File

@ -49,7 +49,7 @@ TALER_TESTING_get_trait_amount_obj
const struct TALER_Amount **amount)
{
return cmd->traits (cmd->cls,
(void **) amount,
(const void **) amount,
TALER_TESTING_TRAIT_AMOUNT,
index);
}

View File

@ -45,10 +45,10 @@ int
TALER_TESTING_get_trait_blinding_key
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_DenominationBlindingKeyP **blinding_key)
const struct TALER_DenominationBlindingKeyP **blinding_key)
{
return cmd->traits (cmd->cls,
(void **) blinding_key,
(const void **) blinding_key,
TALER_TESTING_TRAIT_BLINDING_KEY,
index);
}

View File

@ -50,11 +50,12 @@ TALER_TESTING_get_trait_cmd
struct TALER_TESTING_Command **_cmd)
{
return cmd->traits (cmd->cls,
(void **) _cmd,
(const void **) _cmd,
TALER_TESTING_TRAIT_CMD,
index);
}
/**
* Offer a command in a trait.
*
@ -63,7 +64,6 @@ TALER_TESTING_get_trait_cmd
* example, a "meta" CMD returns always the
* CMD currently being executed.
* @param cmd wire details to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait

View File

@ -39,7 +39,6 @@
* @param cmd command to extract trait from.
* @param index index of the coin priv to obtain.
* @param coin_priv[out] set to the private key of the coin.
*
* @return #GNUNET_OK on success.
*/
int
@ -49,19 +48,17 @@ TALER_TESTING_get_trait_coin_priv
const struct TALER_CoinSpendPrivateKeyP **coin_priv)
{
return cmd->traits (cmd->cls,
(void **) coin_priv,
(const void **) coin_priv,
TALER_TESTING_TRAIT_COIN_PRIVATE_KEY,
index);
}
/**
* Offer coin private key.
*
* @param index index number to associate with offered coin priv.
* @param coin_priv coin private key to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait

View File

@ -48,7 +48,7 @@ TALER_TESTING_get_trait_denom_pub
const struct TALER_EXCHANGE_DenomPublicKey **denom_pub)
{
return cmd->traits (cmd->cls,
(void **) denom_pub,
(const void **) denom_pub,
TALER_TESTING_TRAIT_DENOM_PUB,
index);
}

View File

@ -39,30 +39,27 @@
* @param cmd command to extract the denom sig from.
* @param index index number associated with the denom sig.
* @param denom_sig[out] set to the offered signature.
*
* @return #GNUNET_OK on success.
*/
int
TALER_TESTING_get_trait_denom_sig
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_DenominationSignature **denom_sig)
const struct TALER_DenominationSignature **denom_sig)
{
return cmd->traits (cmd->cls,
(void **) denom_sig,
(const void **) denom_sig,
TALER_TESTING_TRAIT_DENOM_SIG,
index);
}
/**
* Offer denom sig.
*
* @param index index number to associate to the signature on
* offer.
* @param denom_sig the denom sig on offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait

View File

@ -46,7 +46,7 @@ TALER_TESTING_get_trait_exchange_pub
const struct TALER_ExchangePublicKeyP **exchange_pub)
{
return cmd->traits (cmd->cls,
(void **) exchange_pub,
(const void **) exchange_pub,
TALER_TESTING_TRAIT_EXCHANGE_PUB,
index);
}

View File

@ -46,7 +46,7 @@ TALER_TESTING_get_trait_exchange_sig
const struct TALER_ExchangeSignatureP **exchange_sig)
{
return cmd->traits (cmd->cls,
(void **) exchange_sig,
(const void **) exchange_sig,
TALER_TESTING_TRAIT_EXCHANGE_SIG,
index);
}

View File

@ -38,21 +38,21 @@
* @param index which array to pick if @a cmd has multiple
* on offer.
* @param fresh_coins[out] will point to the offered array.
*
* @return #GNUNET_OK on success.
*/
int
TALER_TESTING_get_trait_fresh_coins
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct FreshCoin **fresh_coins)
const struct FreshCoin **fresh_coins)
{
return cmd->traits (cmd->cls,
(void **) fresh_coins,
(const void **) fresh_coins,
TALER_TESTING_TRAIT_FRESH_COINS,
index);
}
/**
* Offer a _array_ of fresh coins.
*

View File

@ -39,7 +39,6 @@
* on offer; usually zero, as one command sticks to
* one bank account.
* @param wire_details[out] where to write the wire details.
*
* @return #GNUNET_OK on success.
*/
int
@ -49,11 +48,12 @@ TALER_TESTING_get_trait_wire_details
const json_t **wire_details)
{
return cmd->traits (cmd->cls,
(void **) wire_details,
(const void **) wire_details,
TALER_TESTING_TRAIT_WIRE_DETAILS,
index);
}
/**
* Offer wire details in a trait.
*
@ -61,7 +61,6 @@ TALER_TESTING_get_trait_wire_details
* on offer; usually zero, as one command sticks to
* one bank account.
* @param wire_details wire details to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait

View File

@ -40,7 +40,6 @@
* @param index (tipically zero) which key to return if there
* are multiple on offer.
* @param priv[out] set to the key coming from @a cmd.
*
* @return #GNUNET_OK on success.
*/
int
@ -50,7 +49,7 @@ TALER_TESTING_get_trait_peer_key
const struct GNUNET_CRYPTO_EddsaPrivateKey **priv)
{
return cmd->traits (cmd->cls,
(void **) priv,
(const void **) priv,
TALER_TESTING_TRAIT_KEY_PEER,
index);
}
@ -62,13 +61,12 @@ TALER_TESTING_get_trait_peer_key
* @param index (tipically zero) which key to return if there are
* multiple on offer.
* @param priv which object should be offered.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_peer_key
(unsigned int index,
struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
{
struct TALER_TESTING_Trait ret = {
.index = index,
@ -97,7 +95,7 @@ TALER_TESTING_get_trait_peer_key_pub
const struct GNUNET_CRYPTO_EddsaPublicKey **pub)
{
return cmd->traits (cmd->cls,
(void **) pub,
(const void **) pub,
TALER_TESTING_TRAIT_KEY_PEER_PUB,
index);
}

View File

@ -38,29 +38,26 @@
* @param cmd command to extract the number from.
* @param index the number's index number.
* @param n[out] set to the number coming from @a cmd.
*
* @return #GNUNET_OK on success.
*/
int
TALER_TESTING_get_trait_uint
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
unsigned int **n)
const unsigned int **n)
{
return cmd->traits (cmd->cls,
(void **) n,
(const void **) n,
TALER_TESTING_TRAIT_UINT,
index);
}
/**
* Offer a number.
*
* @param index the number's index number.
* @param n the number to offer.
*
* @return #GNUNET_OK on success.
*/
struct TALER_TESTING_Trait
@ -92,7 +89,7 @@ TALER_TESTING_get_trait_uint64
const uint64_t **n)
{
return cmd->traits (cmd->cls,
(void **) n,
(const void **) n,
TALER_TESTING_TRAIT_UINT64,
index);
}

View File

@ -51,7 +51,7 @@ TALER_TESTING_get_trait_process
struct GNUNET_OS_Process ***processp)
{
return cmd->traits (cmd->cls,
(void **) processp,
(const void **) processp,
TALER_TESTING_TRAIT_PROCESS,
index);
}

View File

@ -38,17 +38,16 @@
* @param cmd command to extract the reserve priv from.
* @param index reserve priv's index number.
* @param reserve_priv[out] set to the reserve priv.
*
* @return #GNUNET_OK on success.
*/
int
TALER_TESTING_get_trait_reserve_priv
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_ReservePrivateKeyP **reserve_priv)
const struct TALER_ReservePrivateKeyP **reserve_priv)
{
return cmd->traits (cmd->cls,
(void **) reserve_priv,
(const void **) reserve_priv,
TALER_TESTING_TRAIT_RESERVE_PRIVATE_KEY,
index);
}
@ -59,7 +58,6 @@ TALER_TESTING_get_trait_reserve_priv
*
* @param index reserve priv's index number.
* @param reserve_priv reserve private key to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait

View File

@ -43,7 +43,6 @@
* @param index contract terms index number.
* @param contract_terms[out] where to write the contract
* terms.
*
* @return #GNUNET_OK on success.
*/
int
@ -53,7 +52,7 @@ TALER_TESTING_get_trait_contract_terms
const char **contract_terms)
{
return cmd->traits (cmd->cls,
(void **) contract_terms,
(const void **) contract_terms,
TALER_TESTING_TRAIT_CONTRACT_TERMS,
index);
}
@ -63,7 +62,6 @@ TALER_TESTING_get_trait_contract_terms
*
* @param index contract terms index number.
* @param contract_terms contract terms to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
@ -88,7 +86,6 @@ TALER_TESTING_make_trait_contract_terms
* subject to offer.
* @param transfer_subject[out] where to write the offered
* transfer subject.
*
* @return #GNUNET_OK on success.
*/
int
@ -98,7 +95,7 @@ TALER_TESTING_get_trait_transfer_subject
const char **transfer_subject)
{
return cmd->traits (cmd->cls,
(void **) transfer_subject,
(const void **) transfer_subject,
TALER_TESTING_TRAIT_TRANSFER_SUBJECT,
index);
}
@ -143,7 +140,7 @@ TALER_TESTING_get_trait_amount
const char **amount)
{
return cmd->traits (cmd->cls,
(void **) amount,
(const void **) amount,
TALER_TESTING_TRAIT_AMOUNT,
index);
}
@ -188,7 +185,7 @@ TALER_TESTING_get_trait_url
const char **url)
{
return cmd->traits (cmd->cls,
(void **) url,
(const void **) url,
TALER_TESTING_TRAIT_URL,
index);
}
@ -233,7 +230,7 @@ TALER_TESTING_get_trait_order_id
const char **order_id)
{
return cmd->traits (cmd->cls,
(void **) order_id,
(const void **) order_id,
TALER_TESTING_TRAIT_ORDER_ID,
index);
}
@ -278,7 +275,7 @@ TALER_TESTING_get_trait_rejected
const char **rejected_reference)
{
return cmd->traits (cmd->cls,
(void **) rejected_reference,
(const void **) rejected_reference,
TALER_TESTING_TRAIT_REJECTED,
index);
}

View File

@ -44,26 +44,26 @@ int
TALER_TESTING_get_trait_wtid
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_WireTransferIdentifierRawP **wtid)
const struct TALER_WireTransferIdentifierRawP **wtid)
{
return cmd->traits (cmd->cls,
(void **) wtid,
(const void **) wtid,
TALER_TESTING_TRAIT_WTID,
index);
}
/**
* Offer a WTID.
*
* @param index associate the object with this index
* @param wtid which object should be returned
*
* @return the trait.
*/
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_wtid
(unsigned int index,
struct TALER_WireTransferIdentifierRawP *wtid)
const struct TALER_WireTransferIdentifierRawP *wtid)
{
struct TALER_TESTING_Trait ret = {
.index = index,

View File

@ -53,12 +53,11 @@ TALER_TESTING_trait_end ()
* @param ret where to store the result.
* @param trait type of the trait to extract.
* @param index index number of the object to extract.
*
* @return GNUNET_OK if no error occurred, GNUNET_SYSERR otherwise.
* @return #GNUNET_OK if no error occurred, #GNUNET_SYSERR otherwise.
*/
int
TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
void **ret,
const void **ret,
const char *trait,
unsigned int index)
{

View File

@ -434,7 +434,7 @@ struct TALER_TESTING_Command
*/
int
(*traits)(void *cls,
void **ret,
const void **ret,
const char *trait,
unsigned int index);
@ -1499,7 +1499,7 @@ TALER_TESTING_trait_end (void);
*/
int
TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
void **ret,
const void **ret,
const char *trait,
unsigned int index);
@ -1535,7 +1535,7 @@ int
TALER_TESTING_get_trait_reserve_priv
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_ReservePrivateKeyP **reserve_priv);
const struct TALER_ReservePrivateKeyP **reserve_priv);
/**
@ -1602,7 +1602,7 @@ TALER_TESTING_get_trait_exchange_pub
* @param cmd command to extract trait from.
* @param index which process to pick if @a cmd
* has multiple on offer.
* @param coin_priv[out] set to the address of the pointer to the
* @param processp[out] set to the address of the pointer to the
* process.
*
* @return #GNUNET_OK on success.
@ -1611,8 +1611,7 @@ int
TALER_TESTING_get_trait_process
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct GNUNET_OS_Process ***processp);
struct GNUNET_OS_Process ***processp); // FIXME: why is this a ***!? ** should do!
/**
@ -1627,7 +1626,7 @@ TALER_TESTING_get_trait_process
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_process
(unsigned int index,
struct GNUNET_OS_Process **processp);
struct GNUNET_OS_Process **processp); // FIXME: why is this a "**"? * should do!
/**
@ -1658,6 +1657,7 @@ TALER_TESTING_get_trait_coin_priv
unsigned int index,
const struct TALER_CoinSpendPrivateKeyP **coin_priv);
/**
* Offer blinding key.
*
@ -1671,6 +1671,7 @@ TALER_TESTING_make_trait_blinding_key
(unsigned int index,
const struct TALER_DenominationBlindingKeyP *blinding_key);
/**
* Obtain a blinding key from a @a cmd.
*
@ -1684,7 +1685,8 @@ int
TALER_TESTING_get_trait_blinding_key
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_DenominationBlindingKeyP **blinding_key);
const struct TALER_DenominationBlindingKeyP **blinding_key);
/**
* Make a trait for a denomination public key.
@ -1699,6 +1701,7 @@ TALER_TESTING_make_trait_denom_pub
(unsigned int index,
const struct TALER_EXCHANGE_DenomPublicKey *dpk);
/**
* Obtain a denomination public key from a @a cmd.
*
@ -1728,7 +1731,8 @@ int
TALER_TESTING_get_trait_denom_sig
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_DenominationSignature **dpk);
const struct TALER_DenominationSignature **dpk);
/**
* Offer denom sig.
@ -1756,6 +1760,7 @@ TALER_TESTING_make_trait_uint64
(unsigned int index,
const uint64_t *n);
/**
* Obtain a "number" value from @a cmd, 64-bit version.
*
@ -1771,6 +1776,7 @@ TALER_TESTING_get_trait_uint64
unsigned int index,
const uint64_t **n);
/**
* Offer a number.
*
@ -1784,6 +1790,7 @@ TALER_TESTING_make_trait_uint
(unsigned int index,
const unsigned int *i);
/**
* Obtain a number from @a cmd.
*
@ -1797,7 +1804,8 @@ int
TALER_TESTING_get_trait_uint
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
unsigned int **n);
const unsigned int **n);
/**
* Information about a fresh coin generated by the refresh
@ -1825,6 +1833,7 @@ struct FreshCoin
struct TALER_CoinSpendPrivateKeyP coin_priv;
};
/**
* Offer a _array_ of fresh coins.
*
@ -1840,6 +1849,7 @@ TALER_TESTING_make_trait_fresh_coins
(unsigned int index,
struct FreshCoin *fresh_coins);
/**
* Get a array of fresh coins.
*
@ -1854,7 +1864,7 @@ int
TALER_TESTING_get_trait_fresh_coins
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct FreshCoin **fresh_coins);
const struct FreshCoin **fresh_coins);
/**
@ -1936,6 +1946,7 @@ TALER_TESTING_get_trait_peer_key
unsigned int index,
const struct GNUNET_CRYPTO_EddsaPrivateKey **priv);
/**
* Offer private key, typically done when CMD_1 needs it to
* sign a request.
@ -1943,13 +1954,12 @@ TALER_TESTING_get_trait_peer_key
* @param index (tipically zero) which key to return if there are
* multiple on offer.
* @param priv which object should be offered.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_peer_key
(unsigned int index,
struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
/**
@ -1969,6 +1979,7 @@ TALER_TESTING_get_trait_peer_key_pub
unsigned int index,
const struct GNUNET_CRYPTO_EddsaPublicKey **pub);
/**
* Offer public key.
*
@ -1984,6 +1995,7 @@ TALER_TESTING_make_trait_peer_key_pub
(unsigned int index,
struct GNUNET_CRYPTO_EddsaPublicKey *pub);
/**
* Obtain a transfer subject from @a cmd.
*
@ -2008,7 +2020,6 @@ TALER_TESTING_get_trait_transfer_subject
* @param index index number associated with the transfer
* subject being offered.
* @param transfer_subject transfer subject to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
@ -2030,20 +2041,20 @@ int
TALER_TESTING_get_trait_wtid
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_WireTransferIdentifierRawP **wtid);
const struct TALER_WireTransferIdentifierRawP **wtid);
/**
* Offer a WTID.
*
* @param index associate the WTID with this index.
* @param wtid pointer to the WTID to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_wtid
(unsigned int index,
struct TALER_WireTransferIdentifierRawP *wtid);
const struct TALER_WireTransferIdentifierRawP *wtid);
/**
@ -2052,7 +2063,6 @@ TALER_TESTING_make_trait_wtid
* @param index which amount is to be offered,
* in case multiple are offered.
* @param amount the amount to offer.
*
* @return the trait.
*/
struct TALER_TESTING_Trait
@ -2060,6 +2070,7 @@ TALER_TESTING_make_trait_amount
(unsigned int index,
const char *amount);
/**
* Obtain an amount from @a cmd.
*
@ -2091,6 +2102,7 @@ TALER_TESTING_make_trait_url
(unsigned int index,
const char *url);
/**
* Obtain a url from @a cmd.
*
@ -2124,6 +2136,7 @@ TALER_TESTING_get_trait_order_id
unsigned int index,
const char **order_id);
/**
* Offer order id in a trait.
*
@ -2155,6 +2168,7 @@ TALER_TESTING_get_trait_amount_obj
unsigned int index,
const struct TALER_Amount **amount);
/**
* Offer amount.
*
@ -2169,6 +2183,7 @@ TALER_TESTING_make_trait_amount_obj
(unsigned int index,
const struct TALER_Amount *amount);
/**
* Offer a "reject" CMD reference.
*
@ -2218,6 +2233,7 @@ TALER_TESTING_make_trait_cmd
(unsigned int index,
const struct TALER_TESTING_Command *cmd);
/**
* Obtain a command from @a cmd.
*
@ -2226,7 +2242,7 @@ TALER_TESTING_make_trait_cmd
* kind of traits do not need this index. For
* example, a "meta" CMD returns always the
* CMD currently being executed.
* @param cmd_[out] where to write the wire details.
* @param _cmd[out] where to write the wire details.
*
* @return #GNUNET_OK on success.
*/
@ -2235,4 +2251,6 @@ TALER_TESTING_get_trait_cmd
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
struct TALER_TESTING_Command **_cmd);
#endif