3 * UCC (University [of WA] Computer Club) Electronic Accounting System
5 * cokebank.c - Coke-Bank management
7 * This file is licenced under the 3-clause BSD Licence. See the file COPYING
10 * TODO: Make this a Dynamic Library and load it at runtime
16 void Init_Cokebank(void);
17 int Transfer(int SourceUser, int DestUser, int Ammount, const char *Reason);
18 int GetBalance(int User);
19 char *GetUserName(int User);
20 int GetUserID(const char *Username);
21 int GetUserAuth(const char *Username, const char *Password);
25 * \brief Load the cokebank database
27 void Init_Cokebank(void)
33 * \brief Transfers money from one user to another
34 * \param SourceUser Source user
35 * \param DestUser Destination user
36 * \param Ammount Ammount of cents to move from \a SourceUser to \a DestUser
37 * \param Reason Reason for the transfer (essentially a comment)
38 * \return Boolean failure
40 int Transfer(int SourceUser, int DestUser, int Ammount, const char *Reason);
46 * \brief Get the balance of the passed user
48 int GetBalance(int User)
54 * \brief Return the name the passed user
56 char *GetUserName(int User)
62 * \brief Get the User ID of the named user
64 int GetUserID(const char *Username)
70 * \brief Authenticate a user
71 * \return User ID, or -1 if authentication failed
73 int GetUserAuth(const char *Username, const char *Password)