db_matrix.h

Go to the documentation of this file.
00001 
00020 #ifndef db_matrix_h
00021 #define db_matrix_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 matrix_db_url;
00035 extern db1_con_t * matrix_dbh;
00036 extern db_func_t matrix_dbf;
00037 
00038 #define matrix_DB_URL { "db_url", STR_PARAM, &matrix_db_url.s },
00039 
00040 #define matrix_DB_TABLE { "matrix_table", STR_PARAM, &matrix_table.s },
00041 
00042 extern str matrix_table;
00043 
00044 /* column names */
00045 extern str matrix_first_col;
00046 extern str matrix_second_col;
00047 extern str matrix_res_col;
00048 #define matrix_DB_COLS \
00049 { "matrix_first_col", STR_PARAM, &matrix_first_col.s }, \
00050 { "matrix_second_col", STR_PARAM, &matrix_second_col.s }, \
00051 { "matrix_res_col", STR_PARAM, &matrix_res_col.s }, \
00052 
00053 /* table version */
00054 extern const unsigned int matrix_version;
00055 
00056 
00057 /*
00058  * Closes the DB connection.
00059  */
00060 void matrix_db_close(void);
00061 
00068 int matrix_db_init(void);
00069 
00077 int matrix_db_open(void);
00078 
00083 void matrix_db_vars(void);
00084 
00085 #endif