4 * This code is published under the terms of the Acess licence.
5 * See the file COPYING for details.
7 * common.h - Core Header
13 #define DEFAULT_CONFIG_FILE "/etc/opendispense/main.cfg"
15 // === HELPER MACROS ===
17 #define EXPSTR(x) _EXPSTR(x)
20 typedef struct sItem tItem;
23 char *Name; //!< Display Name
26 short Type; //!< References an action
27 short ID; //!< Item ID
30 typedef struct sUser tUser;
33 int ID; //!< User ID (LDAP ID)
34 int Balance; //!< Balance in cents
35 int Bytes; //!< Traffic Usage
36 char Name[]; //!< Username
39 typedef struct sHandler tHandler;
43 int (*CanDispense)(int User, int ID);
44 int (*DoDispense)(int User, int ID);
48 extern tItem *gaItems;
49 extern int giNumItems;
50 extern tHandler *gaHandlers;
54 extern void Log_Error(const char *Format, ...);
55 extern void Log_Info(const char *Format, ...);
57 // --- Cokebank Functions ---
58 extern int AlterBalance(int User, int Ammount);
59 extern int GetBalance(int User);
60 extern char *GetUserName(int User);
61 extern int GetUserID(const char *Username);