SQLite cokebank feature complete, bugfix time
[tpg/opendispense2.git] / src / cokebank.h
index 9450ecf..d94e36f 100644 (file)
 #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
@@ -48,7 +51,7 @@ enum eBank_ItFlags
  */
 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)
@@ -146,14 +149,24 @@ extern int        Bank_GetUserAuth(const char *Salt, const char *Username, const char *
 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

UCC git Repository :: git.ucc.asn.au