1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
/*
* $Id$
*
* BDB Database Driver for SIP-router
*
* Copyright (C) 2008 iptelorg GmbH
*
* This file is part of SIP-router, a free SIP server.
*
* SIP-router is free software; you can redistribute it and/or modify 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.
*
* SIP-router is distributed in the hope that it will be useful, 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 Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _BDB_FLD_H_
#define _BDB_FLD_H_
/** \addtogroup bdb
* @{
*/
/*! \file
* Berkeley DB :
* Implementation of bdb_fld data structure representing BDB fields and
* related functions.
*
* \ingroup database
*/
#include <db.h>
#include "../../lib/srdb2/db_gen.h"
#include "../../lib/srdb2/db_fld.h"
typedef struct _bdb_fld {
db_drv_t gen;
char* name;
int is_null;
unsigned long length;
str buf;
int col_pos;
} bdb_fld_t, *bdb_fld_p;
/** Creates a new BDB specific payload.
* This function creates a new BDB specific payload structure and
* attaches the structure to the generic db_fld structure.
* @param fld A generic db_fld structure to be exended.
* @param table Name of the table on the server.
* @retval 0 on success.
* @retval A negative number on error.
*/
int bdb_fld(db_fld_t* fld, char* table);
/** @} */
#endif /* _BDB_FLD_H_ */
|