src/lib/srdb1/db_con.h
9405692a
 /* 
  * Copyright (C) 2001-2003 FhG Fokus
bc4bf265
  * Copyright (C) 2007-2008 1&1 Internet AG
9405692a
  *
d520eaf5
  * This file is part of Kamailio, a free SIP server.
9405692a
  *
d520eaf5
  * Kamailio is free software; you can redistribute it and/or modify
9405692a
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
d520eaf5
  * Kamailio is distributed in the hope that it will be useful,
9405692a
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
9405692a
  */
 
5b5a6333
 /*!
7d14b037
  * \file lib/srdb1/db_con.h
a33b9a87
  * \ingroup db1
bc4bf265
  * \brief Type that represents a database connection
  */
9405692a
 
2d6bfb46
 #ifndef DB1_CON_H
 #define DB1_CON_H
9405692a
 
cf83221d
 #include "../../core/str.h"
25f17988
 
9405692a
 
5b5a6333
 /*! \brief
bc4bf265
  * This structure represents a database connection, pointer to this structure
  * are used as a connection handle from modules uses the db API.
9405692a
  */
 typedef struct {
5b5a6333
 	const str* table;      /*!< Default table that should be used              */
ffbe9c2c
 	const char *tquote;    /*!< Char to quote special tokens (table/column names) */
5b5a6333
 	unsigned long tail;    /*!< Variable length tail, database module specific */
a5071c50
 } db1_con_t;
9405692a
 
 
bc4bf265
 /** Return the table of the connection handle */
9405692a
 #define CON_TABLE(cn)      ((cn)->table)
ffbe9c2c
 /** Return the tquote of the connection handle */
 #define CON_TQUOTE(cn)     ((cn)->tquote)
 /** Return the tquote of the connection handle or empty str if null */
 #define CON_TQUOTESZ(cn)   (((cn)->tquote)?((cn)->tquote):"")
bc4bf265
 /** Return the tail of the connection handle */
9405692a
 #define CON_TAIL(cn)       ((cn)->tail)
 
 
2d6bfb46
 #endif /* DB1_CON_H */