Restructured code into src/<module>
[tpg/opendispense2.git] / src / cokebank / main.c
1 /*
2  * OpenDispense 2 
3  * UCC (University [of WA] Computer Club) Electronic Accounting System
4  *
5  * cokebank.c - Coke-Bank management
6  *
7  * This file is licenced under the 3-clause BSD Licence. See the file COPYING
8  * for full details.
9  * 
10  * TODO: Make this a Dynamic Library and load it at runtime
11  */
12 #include <stdlib.h>
13 #include <stdio.h>
14
15 // === PROTOTYPES ===
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);
22
23 // === CODE ===
24 /**
25  * \brief Load the cokebank database
26  */
27 void Init_Cokebank(void)
28 {
29         
30 }
31
32 /**
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
39  */
40 int Transfer(int SourceUser, int DestUser, int Ammount, const char *Reason);
41 {
42         return 0;
43 }
44
45 /**
46  * \brief Get the balance of the passed user
47  */
48 int GetBalance(int User)
49 {
50         return 0;
51 }
52
53 /**
54  * \brief Return the name the passed user
55  */
56 char *GetUserName(int User)
57 {
58         return NULL;
59 }
60
61 /**
62  * \brief Get the User ID of the named user
63  */
64 int GetUserID(const char *Username)
65 {
66         return -1;
67 }
68
69 /**
70  * \brief Authenticate a user
71  * \return User ID, or -1 if authentication failed
72  */
73 int GetUserAuth(const char *Username, const char *Password)
74 {
75         return -1;
76 }
77

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