aboutsummaryrefslogtreecommitdiff
path: root/brandt.h
diff options
context:
space:
mode:
Diffstat (limited to 'brandt.h')
-rw-r--r--brandt.h62
1 files changed, 32 insertions, 30 deletions
diff --git a/brandt.h b/brandt.h
index b967656..b02220f 100644
--- a/brandt.h
+++ b/brandt.h
@@ -32,24 +32,26 @@
struct BRANDT_Auction;
/** Enumeration of all possible status reports for a single bidder */
-enum BRANDT_BidderStatus {
- BRANDT_bidder_won,
+enum BRANDT_BidderStatus
+{
+ BRANDT_bidder_won,
};
/**
* An array of this struct is given to the application by the BRANDT_CbResult()
* callback. One instance represents the status of a single bidder.
*/
-struct BRANDT_Result {
- /** Id of the bidder this instance refers to */
- uint16_t bidder;
+struct BRANDT_Result
+{
+ /** Id of the bidder this instance refers to */
+ uint16_t bidder;
- /** The price the bidder has to pay. This value is only set if the #status
- * indicates the bidder has won. */
- uint16_t price;
+ /** The price the bidder has to pay. This value is only set if the #status
+ * indicates the bidder has won. */
+ uint16_t price;
- /** Status of the bidder */
- enum BRANDT_BidderStatus status;
+ /** Status of the bidder */
+ enum BRANDT_BidderStatus status;
};
/**
@@ -85,7 +87,7 @@ typedef uint16_t
typedef int
(*BRANDT_CbDeliver)(void *auction_closure,
const void *msg,
- size_t msg_len);
+ size_t msg_len);
/**
@@ -104,7 +106,7 @@ typedef int
typedef void
(*BRANDT_CbResult)(void *auction_closure,
struct BRANDT_Result results[],
- uint16_t results_len);
+ uint16_t results_len);
void
@@ -126,7 +128,7 @@ BRANDT_init ();
*/
int
BRANDT_parse_desc (const void *auction_desc,
- size_t auction_desc_len,
+ size_t auction_desc_len,
struct GNUNET_TIME_Absolute *time_start,
struct GNUNET_TIME_Relative *time_round,
uint16_t *num_prices,
@@ -156,13 +158,13 @@ BRANDT_parse_desc (const void *auction_desc,
* black-box pointer, do NOT dereference/change it or the data it points to!
*/
struct BRANDT_Auction *
-BRANDT_join (BRANDT_CbResult result,
- BRANDT_CbDeliver broadcast,
- BRANDT_CbDeliver unicast,
+BRANDT_join (BRANDT_CbResult result,
+ BRANDT_CbDeliver broadcast,
+ BRANDT_CbDeliver unicast,
void *auction_closure,
const void *auction_desc,
- size_t auction_desc_len,
- uint16_t bid,
+ size_t auction_desc_len,
+ uint16_t bid,
struct GNUNET_CRYPTO_EccDlogContext *dlogctx);
@@ -201,17 +203,17 @@ BRANDT_join (BRANDT_CbResult result,
* black-box pointer, do NOT dereference/change it or the data it points to!
*/
struct BRANDT_Auction *
-BRANDT_new (BRANDT_CbResult result,
- BRANDT_CbDeliver broadcast,
- BRANDT_CbStart start,
+BRANDT_new (BRANDT_CbResult result,
+ BRANDT_CbDeliver broadcast,
+ BRANDT_CbStart start,
void *auction_closure,
void **auction_desc,
size_t *auction_desc_len,
- struct GNUNET_TIME_Absolute time_start,
- struct GNUNET_TIME_Relative time_round,
- uint16_t num_prices,
- uint16_t m,
- int outcome_public,
+ struct GNUNET_TIME_Absolute time_start,
+ struct GNUNET_TIME_Relative time_round,
+ uint16_t num_prices,
+ uint16_t m,
+ int outcome_public,
struct GNUNET_CRYPTO_EccDlogContext *dlogctx);
@@ -226,8 +228,8 @@ BRANDT_new (BRANDT_CbResult result,
*/
void
BRANDT_bidder_start (struct BRANDT_Auction *auction,
- uint16_t i,
- uint16_t n);
+ uint16_t i,
+ uint16_t n);
/**
@@ -253,9 +255,9 @@ BRANDT_destroy (struct BRANDT_Auction *auction);
*/
void
BRANDT_got_message (struct BRANDT_Auction *auction,
- uint16_t sender,
+ uint16_t sender,
const unsigned char *msg,
- size_t msg_len);
+ size_t msg_len);
/**\todo: Error handling functions? */