db_ut.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  * Copyright (C) 2007-2008 1&1 Internet AG
00006  *
00007  * This file is part of Kamailio, a free SIP server.
00008  *
00009  * Kamailio is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version
00013  *
00014  * Kamailio is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License 
00020  * along with this program; if not, write to the Free Software 
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  */
00023 
00033 #ifndef DB1_UT_H
00034 #define DB1_UT_H
00035 
00036 #include "../../pvar.h"
00037 
00038 #include "db_key.h"
00039 #include "db.h"
00040 
00041 
00049 int db_str2int(const char* _s, int* _v);
00050 
00051 
00059 int db_str2longlong(const char* _s, long long* _v);
00060 
00061 
00069 int db_str2double(const char* _s, double* _v);
00070 
00071 
00080 int db_int2str(int _v, char* _s, int* _l);
00081 
00082 
00091 int db_longlong2str(long long _v, char* _s, int* _l);
00092 
00093 
00102 int db_double2str(double _v, char* _s, int* _l);
00103 
00104 
00116 int db_time2str(time_t _v, char* _s, int* _l);
00117 
00118 
00126 int db_str2time(const char* _s, time_t* _v);
00127 
00128 
00138 int db_print_columns(char* _b, const int _l, const db_key_t* _c, const int _n);
00139 
00140 
00152 int db_print_values(const db1_con_t* _c, char* _b, const int _l, const db_val_t* _v,
00153         const int _n, int (*val2str)(const db1_con_t*, const db_val_t*, char*, int*));
00154 
00155 
00169 int db_print_where(const db1_con_t* _c, char* _b, const int _l, const db_key_t* _k,
00170         const db_op_t* _o, const db_val_t* _v, const int _n, int (*val2str)
00171         (const  db1_con_t*, const db_val_t*, char*, int*));
00172 
00173 
00186 int db_print_set(const db1_con_t* _c, char* _b, const int _l,
00187         const db_key_t* _k, const db_val_t* _v, const int _n, int (*val2str)
00188         (const db1_con_t*, const db_val_t*, char*, int*));
00189 
00190 
00199 int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs);
00200 
00201 #endif