bdb_vals.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_VALS_H_
00030 #define _BDB_VALS_H_
00031 
00032 /* table row */
00033 int bdb_row_db2bdb(db_con_t* _h, db_key_t* _k, db_val_t* _v, int _n, bdb_row_p *_r);
00034 
00035 void bdb_free_row(bdb_row_p _r);
00036 void bdb_free_row_list(bdb_row_p _r);
00037 
00038 int bdb_set_key(bdb_row_p _r, bdb_val_p _v);
00039 
00040 void bdb_push_field(bdb_row_p _r, bdb_val_p _v);
00041 void bdb_free_field(bdb_val_p _v);
00042 void bdb_free_field_list(bdb_val_p _v);
00043 
00044 void bdb_push_data(bdb_row_p _r, bdb_val_p _v);
00045 void bdb_merge_tail(bdb_row_p _r);
00046 
00047 int bdb_field_db2bdb(bdb_val_p v, db_val_t* _v);
00048 
00049 
00050 /* search row */
00051 int bdb_srow_db2bdb(db_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v, int _n, bdb_srow_p *_r);
00052 void bdb_free_srow(bdb_srow_p _r);
00053 
00054 void bdb_set_skey(bdb_srow_p _r, bdb_sval_p _v);
00055 
00056 void bdb_push_sfield(bdb_srow_p _r, bdb_sval_p _v);
00057 void bdb_free_sfield(bdb_sval_p _v);
00058 void bdb_free_sfield_list(bdb_sval_p _v);
00059 
00060 int bdb_sfield_db2bdb(bdb_sval_p v, db_val_t* _v, db_op_t _op);
00061 
00062 /* result row */
00063 int bdb_rrow_db2bdb(db_con_t* _h, db_key_t* _k, int _n, bdb_rrow_p *_r);
00064 void bdb_free_rrow(bdb_rrow_p _r);
00065 
00066 /* update row */
00067 int bdb_urow_db2bdb(db_con_t* _h, db_key_t* _k, db_val_t* _v, int _n, bdb_urow_p *_r);
00068 void bdb_free_urow(bdb_urow_p _r);
00069 
00070 void bdb_push_ufield(bdb_urow_p _r, bdb_uval_p _v);
00071 void bdb_free_ufield(bdb_uval_p _v);
00072 void bdb_free_ufield_list(bdb_uval_p _v);
00073 
00074 int bdb_ufield_db2bdb(bdb_uval_p v, db_val_t* _v);
00075 
00076 int bdb_set_row(db_con_t* _h, bdb_urow_p u_r, bdb_val_p _v, bdb_row_p _r);
00077 
00078 /* query */
00079 int bdb_get_db_row(db_con_t* _h, DBT* _data, bdb_val_p *_v);
00080 
00081 #endif