capitalize name prefix of public interface functions
This commit is contained in:
parent
5b885c1e62
commit
2ab5ca5860
38
brandt.h
38
brandt.h
@ -22,7 +22,7 @@
|
||||
#ifndef _BRANDT_BRANDT_H
|
||||
#define _BRANDT_BRANDT_H
|
||||
|
||||
struct brandt_auction;
|
||||
struct BRANDT_auction;
|
||||
|
||||
/**
|
||||
* Functions of this type are called by libbrandt to broadcast messages to the
|
||||
@ -31,13 +31,13 @@ struct brandt_auction;
|
||||
* TODO: how must the message be handled? (encryption, auth, reliability, …)
|
||||
*
|
||||
* @param[in] auction_closure Closure pointer representing the respective
|
||||
* auction. This is the Pointer given to brandt_join().
|
||||
* auction. This is the Pointer given to BRANDT_join().
|
||||
* @param[in] msg The message to be broadcast to all participants of
|
||||
* @a auction_closure.
|
||||
* @param[in] msg_len The length of the message @a msg in bytes.
|
||||
* @return 1 on success, 0 on failure.
|
||||
*/
|
||||
typedef int (*brandt_cb_broadcast) (void *auction_closure, const void *msg, size_t msg_len);
|
||||
typedef int (*BRANDT_cb_broadcast) (void *auction_closure, const void *msg, size_t msg_len);
|
||||
|
||||
/**
|
||||
* Functions of this type are called by libbrandt to unicast messages to the
|
||||
@ -46,12 +46,12 @@ typedef int (*brandt_cb_broadcast) (void *auction_closure, const void *msg, size
|
||||
* TODO: how must the message be handled? (encryption, auth, reliability, …)
|
||||
*
|
||||
* @param[in] auction_closure Closure pointer representing the respective
|
||||
* auction. This is the Pointer given to brandt_join().
|
||||
* auction. This is the Pointer given to BRANDT_join().
|
||||
* @param[in] msg The message to be sent to the seller of @a auction_closure.
|
||||
* @param[in] msg_len The length of the message @a msg in bytes.
|
||||
* @return 1 on success, 0 on failure.
|
||||
*/
|
||||
typedef int (*brandt_cb_unicast_seller) (void *auction_closure, const void *msg, size_t msg_len);
|
||||
typedef int (*BRANDT_cb_unicast_seller) (void *auction_closure, const void *msg, size_t msg_len);
|
||||
|
||||
/**
|
||||
* Functions of this type are called by libbrandt to report the auction outcome
|
||||
@ -60,12 +60,12 @@ typedef int (*brandt_cb_unicast_seller) (void *auction_closure, const void *msg,
|
||||
* TODO: update price type. Don't do this notification as a callback?
|
||||
*
|
||||
* @param[in] auction_closure Closure pointer representing the respective
|
||||
* auction. This is the Pointer given to brandt_join().
|
||||
* auction. This is the Pointer given to BRANDT_join().
|
||||
* @param[in] won 1 if the user has won the auction, 0 otherwise.
|
||||
* @param[in] price The price, the winner has to pay or 0 if the auction result
|
||||
* is private and the user did not win.
|
||||
*/
|
||||
typedef void (*brandt_cb_report_result) (void *auction_closure, int won, uint16_t price);
|
||||
typedef void (*BRANDT_cb_report_result) (void *auction_closure, int won, uint16_t price);
|
||||
|
||||
/**
|
||||
* Join an auction described by the @a auction_data parameter.
|
||||
@ -75,16 +75,16 @@ typedef void (*brandt_cb_report_result) (void *auction_closure, int won, uint16_
|
||||
* @param[in] auction_closure Closure pointer representing the auction. This
|
||||
* will not be touched by libbrandt. It is only passed to the callbacks.
|
||||
* @param[in] auction_data The auction information data a an opaque data
|
||||
* structure. It will be parsed and checked by brandt_join.
|
||||
* structure. It will be parsed and checked by BRANDT_join().
|
||||
* @param[in] auction_data_len The length in bytes of the @a auction_data
|
||||
* structure.
|
||||
* @return A pointer, which should only be remembered and passed to
|
||||
* libbrandt functions when the client needs to refer to this auction. This is a
|
||||
* black-box pointer, do NOT access/change it or the data it points to!
|
||||
*/
|
||||
const struct brandt_auction *brandt_join (brandt_cb_broadcast broadcast,
|
||||
brandt_cb_unicast_seller unicast,
|
||||
brandt_cb_report_result report,
|
||||
const struct BRANDT_auction *BRANDT_join (BRANDT_cb_broadcast broadcast,
|
||||
BRANDT_cb_unicast_seller unicast,
|
||||
BRANDT_cb_report_result report,
|
||||
const void *auction_closure,
|
||||
const void *auction_data,
|
||||
size_t auction_data_len);
|
||||
@ -96,10 +96,10 @@ const struct brandt_auction *brandt_join (brandt_cb_broadcast broadcast,
|
||||
* @param[in] auction_closure Closure pointer representing the auction. This
|
||||
* will not be touched by libbrandt. It is only passed to the callbacks.
|
||||
* @param[out] auction_data The auction information data a an opaque data
|
||||
* structure. It will be generated by brandt_new and should be distributed to
|
||||
* structure. It will be generated by BRANDT_new() and should be distributed to
|
||||
* all possibly interested bidders.
|
||||
* @param[out] auction_data_len The length in bytes of the @a auction_data
|
||||
* structure. Will be filled by brandt_new.
|
||||
* structure. Will be filled by BRANDT_new().
|
||||
* @param[in] num_prices The amount of possible valuations for the sold item(s).
|
||||
* If 0, a default of 256 will be used. TODO: what about 1, does it work with
|
||||
* second price auctions?
|
||||
@ -114,8 +114,8 @@ const struct brandt_auction *brandt_join (brandt_cb_broadcast broadcast,
|
||||
* libbrandt functions when the client needs to refer to this auction. This is a
|
||||
* black-box pointer, do NOT access/change it or the data it points to!
|
||||
*/
|
||||
const struct brandt_auction *brandt_new (brandt_cb_broadcast broadcast,
|
||||
brandt_cb_report_result report,
|
||||
const struct BRANDT_auction *BRANDT_new (BRANDT_cb_broadcast broadcast,
|
||||
BRANDT_cb_report_result report,
|
||||
const void *auction_closure,
|
||||
const void **auction_data,
|
||||
size_t *auction_data_len,
|
||||
@ -125,22 +125,22 @@ const struct brandt_auction *brandt_new (brandt_cb_broadcast broadcast,
|
||||
|
||||
/**
|
||||
* Receive a broadcast message related to a specific auction.
|
||||
* @param[in] auction The pointer returned by brandt_join() or brandt_new() from
|
||||
* @param[in] auction The pointer returned by BRANDT_join() or BRANDT_new() from
|
||||
* which message @a msg was received.
|
||||
* @param[in] msg The message that was received.
|
||||
* @param[in] msg_len The length in bytes of @a msg.
|
||||
*/
|
||||
void brandt_got_broadcast (struct brandt_auction *auction, void *msg, size_t msg_len);
|
||||
void BRANDT_got_broadcast (struct BRANDT_auction *auction, void *msg, size_t msg_len);
|
||||
|
||||
/**
|
||||
* Receive a unicast message from a bidder related to a specific auction.
|
||||
* @param[in] auction The pointer returned by brandt_new() from which message
|
||||
* @param[in] auction The pointer returned by BRANDT_new() from which message
|
||||
* @a msg was received.
|
||||
* @param[in] msg The message that was received.
|
||||
* @param[in] msg_len The length in bytes of @a msg.
|
||||
* TODO: how to link message to sender id within auction?
|
||||
*/
|
||||
void brandt_got_unicast (struct brandt_auction *auction, void *msg, size_t msg_len);
|
||||
void BRANDT_got_unicast (struct BRANDT_auction *auction, void *msg, size_t msg_len);
|
||||
|
||||
///TODO: Error handling functions?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user