bdb.h

00001 /* $Id$
00002  *
00003  * Copyright (C) 2006-2007 Sippy Software, Inc. <sales@sippysoft.com>
00004  *
00005  * This file is part of ser, a free SIP server.
00006  *
00007  * ser is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version
00011  *
00012  * For a license to use the ser software under conditions
00013  * other than those described here, or to purchase support for this
00014  * software, please contact iptel.org by e-mail at the following addresses:
00015  *    info@iptel.org
00016  *
00017  * ser is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 
00029 #ifndef _BDB_H_
00030 #define _BDB_H_
00031 
00032 #include <stdio.h>
00033 #include <unistd.h>
00034 #include <stdlib.h>
00035 #include <sys/param.h>
00036 #include <string.h>
00037 #include <db.h>
00038 
00039 #include "../../sr_module.h"
00040 #include "../../dprint.h"
00041 #include "../../mem/mem.h"
00042 #include "../../str.h"
00043 #include "../../timer.h"
00044 #include "../../lib/srdb2/db_con.h"
00045 #include "../../lib/srdb2/db_res.h"
00046 #include "../../db/db_key.h"
00047 #include "../../db/db_op.h"
00048 #include "../../db/db_val.h"
00049 
00050 #include "bdb_res.h"
00051 #include "bdb_api.h"
00052 #include "bdb_vals.h"
00053 
00054 extern bdb_table_p      bdb_tables;
00055 
00056 db_con_t* bdb_init(const char* _sqlurl);
00057 void bdb_close(db_con_t* _h);
00058 int bdb_free_result(db_con_t* _h, db_res_t* _r);
00059 int bdb_query(db_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v, 
00060                         db_key_t* _c, int _n, int _nc, db_key_t _o, db_res_t** _r);
00061 int bdb_raw_query(db_con_t* _h, char* _s, db_res_t** _r);
00062 int bdb_insert(db_con_t* _h, db_key_t* _k, db_val_t* _v, int _n);
00063 int bdb_delete(db_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _v, int _n);
00064 int bdb_update(db_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _v,
00065               db_key_t* _uk, db_val_t* _uv, int _n, int _un);
00066 
00067 #endif
00068