modules_s/dbtext/dbt_res.h

00001 /*
00002  * $Id$
00003  *
00004  * DBText module core functions
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  *
00008  * This file is part of ser, a free SIP server.
00009  *
00010  * ser is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * For a license to use the ser software under conditions
00016  * other than those described here, or to purchase support for this
00017  * software, please contact iptel.org by e-mail at the following addresses:
00018  *    info@iptel.org
00019  *
00020  * ser is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License 
00026  * along with this program; if not, write to the Free Software 
00027  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028  */
00029 
00038 #ifndef _DBT_RES_H_
00039 #define _DBT_RES_H_
00040 
00041 #include "../../db/db_op.h"
00042 #include "../../lib/srdb2/db_res.h"
00043 
00044 #include "dbt_lib.h"
00045 
00046 typedef struct _dbt_result
00047 {
00048         int nrcols;
00049         int nrrows;
00050         dbt_column_p colv;
00051         dbt_row_p rows;
00052 } dbt_result_t, *dbt_result_p;
00053 
00054 //typedef db_res_t dbt_result_t, *dbt_result_p;
00055 
00056 typedef struct _dbt_con
00057 {
00058         dbt_cache_p con;
00059         dbt_result_p res;
00060         dbt_row_p row;
00061 } dbt_con_t, *dbt_con_p;
00062 
00063 #define DBT_CON_CONNECTION(db_con) (((dbt_con_p)((db_con)->tail))->con)
00064 #define DBT_CON_RESULT(db_con)     (((dbt_con_p)((db_con)->tail))->res)
00065 #define DBT_CON_ROW(db_con)        (((dbt_con_p)((db_con)->tail))->row)
00066 
00067 dbt_result_p dbt_result_new(dbt_table_p, int*, int);
00068 int dbt_result_free(dbt_result_p);
00069 int dbt_row_match(dbt_table_p _dtp, dbt_row_p _drp, int* _lkey,
00070                                  db_op_t* _op, db_val_t* _v, int _n);
00071 int dbt_result_extract_fields(dbt_table_p _dtp, dbt_row_p _drp,
00072                                 int* lres, dbt_result_p _dres);
00073 int dbt_result_print(dbt_result_p _dres);
00074 
00075 int* dbt_get_refs(dbt_table_p, db_key_t*, int);
00076 int dbt_cmp_val(dbt_val_p _vp, db_val_t* _v);
00077 dbt_row_p dbt_result_new_row(dbt_result_p _dres);
00078 int dbt_is_neq_type(db_type_t _t0, db_type_t _t1);
00079 
00080 #endif
00081