1 /* 2 * $Id: perlvdbfunc.h 770 2007-01-22 10:16:34Z bastian $ 3 * 4 * Perl virtual database module interface 5 * 6 * Copyright (C) 2007 Collax GmbH 7 * (Bastian Friedrich <bastian.friedrich@collax.com>) 8 * 9 * This file is part of Kamailio, a free SIP server. 10 * 11 * Kamailio is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version 15 * 16 * Kamailio is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 */ 25 26 #ifndef _PERLVDBFUNC_H 27 #define _PERLVDBFUNC_H 28 29 #include "../../lib/srdb1/db_val.h" 30 #include "../../lib/srdb1/db_key.h" 31 #include "../../lib/srdb1/db_op.h" 32 #include "../../lib/srdb1/db_con.h" 33 #include "../../lib/srdb1/db_res.h" 34 #include "../../core/str.h" 35 36 37 /* 38 * Initialize/close database module 39 * No function should be called before/after this 40 */ 41 db1_con_t* perlvdb_db_init(const str* _url); 42 void perlvdb_db_close(db1_con_t* h); 43 44 /* 45 * Store name of table that will be used by 46 * subsequent database functions 47 */ 48 int perlvdb_use_table(db1_con_t* h, const str* t); 49 50 int perlvdb_db_insert(const db1_con_t* h, const db_key_t* k, const db_val_t* v, const int n); 51 int perlvdb_db_replace(const db1_con_t* h, const db_key_t* k, const db_val_t* v, 52 const int n, const int un, const int m); 53 int perlvdb_db_delete(const db1_con_t* h, const db_key_t* k, const db_op_t* o, 54 const db_val_t* v, const int n); 55 int perlvdb_db_update(const db1_con_t* h, const db_key_t* k, const db_op_t* o, 56 const db_val_t* v, const db_key_t* uk, const db_val_t* uv, 57 const int n, const int un); 58 59 int perlvdb_db_query(const db1_con_t* h, const db_key_t* k, const db_op_t* op, 60 const db_val_t* v, const db_key_t* c, const int n, const int nc, 61 const db_key_t o, db1_res_t** r); 62 int perlvdb_db_free_result(db1_con_t* _h, db1_res_t* _r); 63 64 #endif /* _PERLVDBFUNC_H */ 65