db_userblacklist.h

Go to the documentation of this file.
00001 
00020 #ifndef db_userblacklist_h
00021 #define db_userblacklist_h
00022 
00023 
00024 /* necessary includes */
00025 #include "../../lib/srdb1/db.h"
00026 #include "../../str.h"
00027 #include "../../ut.h"
00028 
00029 #include <string.h>
00030 
00031 
00032 /* database variables */
00033 
00034 extern str userblacklist_db_url;
00035 extern db1_con_t * userblacklist_dbh;
00036 extern db_func_t userblacklist_dbf;
00037 
00038 #define userblacklist_DB_URL { "db_url", STR_PARAM, &userblacklist_db_url.s },
00039 
00040 #define userblacklist_DB_TABLE { "userblacklist_table", STR_PARAM, &userblacklist_table.s },
00041 
00042 extern str userblacklist_table;
00043 
00044 /* column names */
00045 extern str userblacklist_id_col;
00046 extern str userblacklist_username_col;
00047 extern str userblacklist_domain_col;
00048 extern str userblacklist_prefix_col;
00049 extern str userblacklist_whitelist_col;
00050 #define userblacklist_DB_COLS \
00051 { "userblacklist_id_col", STR_PARAM, &userblacklist_id_col.s }, \
00052 { "userblacklist_username_col", STR_PARAM, &userblacklist_username_col.s }, \
00053 { "userblacklist_domain_col", STR_PARAM, &userblacklist_domain_col.s }, \
00054 { "userblacklist_prefix_col", STR_PARAM, &userblacklist_prefix_col.s }, \
00055 { "userblacklist_whitelist_col", STR_PARAM, &userblacklist_whitelist_col.s }, \
00056 
00057 /* table version */
00058 extern const unsigned int userblacklist_version;
00059 
00060 #define globalblacklist_DB_TABLE { "globalblacklist_table", STR_PARAM, &globalblacklist_table.s },
00061 
00062 extern str globalblacklist_table;
00063 
00064 /* column names */
00065 extern str globalblacklist_id_col;
00066 extern str globalblacklist_prefix_col;
00067 extern str globalblacklist_whitelist_col;
00068 extern str globalblacklist_description_col;
00069 #define globalblacklist_DB_COLS \
00070 { "globalblacklist_id_col", STR_PARAM, &globalblacklist_id_col.s }, \
00071 { "globalblacklist_prefix_col", STR_PARAM, &globalblacklist_prefix_col.s }, \
00072 { "globalblacklist_whitelist_col", STR_PARAM, &globalblacklist_whitelist_col.s }, \
00073 { "globalblacklist_description_col", STR_PARAM, &globalblacklist_description_col.s }, \
00074 
00075 /* table version */
00076 extern const unsigned int globalblacklist_version;
00077 
00078 
00079 /*
00080  * Closes the DB connection.
00081  */
00082 void userblacklist_db_close(void);
00083 
00090 int userblacklist_db_init(void);
00091 
00099 int userblacklist_db_open(void);
00100 
00105 void userblacklist_db_vars(void);
00106 
00107 #endif