db_userblacklist.h

Go to the documentation of this file.
00001 
00002 /*!
00003  * \file
00004  * \ingroup db
00005  * \brief Database support for modules.
00006  *
00007  * Database support functions for modules.
00008  *
00009  * @cond
00010  * WARNING:
00011  * This file was autogenerated from the XML source file
00012  * ../../modules/userblacklist/kamailio-userblacklist.xml.
00013  * It can be regenerated by running 'make modules' in the db/schema
00014  * directory of the source code. You need to have xsltproc and
00015  * docbook-xsl stylesheets installed.
00016  * ALL CHANGES DONE HERE WILL BE LOST IF THE FILE IS REGENERATED
00017  * @endcond
00018  */
00019 
00020 #ifndef db_userblacklist_h
00021 #define db_userblacklist_h
00022 
00023 
00024 /* necessary includes */
00025 #include "../../db/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 db_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, &userblacklist_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 
00084 /*!
00085  * Initialises the DB API, check the table version and closes the connection.
00086  * This should be called from the mod_init function.
00087  *
00088  * \return 0 means ok, -1 means an error occured.
00089  */
00090 int userblacklist_db_init(void);
00091 
00092 /*!
00093  * Initialize the DB connection without checking the table version and DB URL.
00094  * This should be called from child_init. An already existing database
00095  * connection will be closed, and a new one created.
00096  *
00097  * \return 0 means ok, -1 means an error occured.
00098  */
00099 int userblacklist_db_open(void);
00100 
00101 /*!
00102  * Update the variable length after eventual assignments from the config script.
00103  * This is necessary because we're using the 'str' type.
00104  */
00105 void userblacklist_db_vars(void);
00106 
00107 #endif

Generated on Tue May 22 14:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6