dbt_res.h

Go to the documentation of this file.
00001 /*
00002  * $Id: dbt_res.h 5713 2009-03-16 17:29:25Z henningw $
00003  *
00004  * DBText module core functions
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio 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  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  * 
00024  * History:
00025  * --------
00026  * 2003-02-04 created by Daniel
00027  * 
00028  */
00029 
00030 
00031 #ifndef _DBT_RES_H_
00032 #define _DBT_RES_H_
00033 
00034 #include "../../db/db_op.h"
00035 #include "../../db/db_res.h"
00036 
00037 #include "dbt_lib.h"
00038 
00039 typedef struct _dbt_result
00040 {
00041    int nrcols;
00042    int nrrows;
00043    dbt_column_p colv;
00044    dbt_row_p rows;
00045 } dbt_result_t, *dbt_result_p;
00046 
00047 //typedef db_res_t dbt_result_t, *dbt_result_p;
00048 
00049 typedef struct _dbt_con
00050 {
00051    dbt_cache_p con;
00052    dbt_result_p res;
00053    dbt_row_p row;
00054 } dbt_con_t, *dbt_con_p;
00055 
00056 #define DBT_CON_CONNECTION(db_con) (((dbt_con_p)((db_con)->tail))->con)
00057 #define DBT_CON_RESULT(db_con)     (((dbt_con_p)((db_con)->tail))->res)
00058 #define DBT_CON_ROW(db_con)        (((dbt_con_p)((db_con)->tail))->row)
00059 
00060 dbt_result_p dbt_result_new(dbt_table_p, int*, int);
00061 int dbt_result_free(dbt_result_p);
00062 int dbt_row_match(dbt_table_p _dtp, dbt_row_p _drp, int* _lkey,
00063              db_op_t* _op, db_val_t* _v, int _n);
00064 int dbt_result_extract_fields(dbt_table_p _dtp, dbt_row_p _drp,
00065             int* lres, dbt_result_p _dres);
00066 int dbt_result_print(dbt_result_p _dres);
00067 
00068 int* dbt_get_refs(dbt_table_p, db_key_t*, int);
00069 int dbt_cmp_val(dbt_val_p _vp, db_val_t* _v);
00070 dbt_row_p dbt_result_new_row(dbt_result_p _dres);
00071 
00072 int dbt_parse_orderbyclause(db_key_t **_o_k, char **_o_op, int *_o_n, db_key_t _o);
00073 int dbt_mangle_columnselection(int **_lres, int *_nc, int *_o_nc, int *_o_l, int _o_n);
00074 int dbt_sort_result(dbt_result_p _dres, int *_o_l, char *_o_op, int _o_n, int *_lres, int _nc);
00075 void dbt_project_result(dbt_result_p _dres, int _o_nc);
00076 
00077 #endif
00078 

Generated on Tue May 22 14:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6