#ifndef _COKEBANK_H_
#define _COKEBANK_H_
+#include <stdlib.h>
+
#define COKEBANK_SALES_ACCT ">sales" //!< Sales made into
#define COKEBANK_DEBT_ACCT ">liability" //!< Credit taken out of
+#define COKEBANK_FREE_ACCT ">freeitems" //!< ODay drink costs taken out of
/**
* \brief Account iterator opaque structure
*/
enum eCokebank_Flags {
USER_FLAG_COKE = 0x01, //!< User is a coke member (can do coke accounting)
- USER_FLAG_WHEEL = 0x02, //!< User is a wheel member (can create, delete and lock accounts)
+ USER_FLAG_ADMIN = 0x02, //!< User is a administrator (can create, delete and lock accounts)
USER_FLAG_DOORGROUP = 0x04, //!< User is in the door group (can open the clubroom door)
USER_FLAG_INTERNAL = 0x40, //!< Account is internal (cannot be authenticated, no lower balance limit)
USER_FLAG_DISABLED = 0x80 //!< Account is disabled (no transactions allowed)
extern int Bank_GetAcctByCard(const char *CardID);
/**
- * \brief Add a card to an git account
- * \param User User ID
+ * \brief Add a card to an account
+ * \param AcctID Account ID
* \param CardID MIFARE card ID
* \return Boolean failure
* \retval 0 Success
- * \retval 1 Bad user ID
+ * \retval 1 Bad account ID
* \retval 2 Card in use
*/
-extern int Bank_AddUserCard(int User, const char *CardID);
+extern int Bank_AddAcctCard(int AcctID, const char *CardID);
+
+// ---
+// Server provided helper functions
+// ---
+/**
+ * \brief Create a formatted string on the heap
+ * \param Format Format string
+ * \return Heap string
+ */
+extern char *mkstr(const char *Format, ...);
#endif