bdb_fld.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * $Id$
  3. *
  4. * BDB Database Driver for SIP-router
  5. *
  6. * Copyright (C) 2008 iptelorg GmbH
  7. *
  8. * This file is part of SIP-router, a free SIP server.
  9. *
  10. * SIP-router is free software; you can redistribute it and/or modify it under the
  11. * terms of the GNU General Public License as published by the Free Software
  12. * Foundation; either version 2 of the License, or (at your option) any later
  13. * version.
  14. *
  15. * SIP-router is distributed in the hope that it will be useful, but WITHOUT ANY
  16. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  17. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  18. * details.
  19. *
  20. * You should have received a copy of the GNU General Public License along
  21. * with this program; if not, write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. #ifndef _BDB_FLD_H_
  25. #define _BDB_FLD_H_
  26. /** \addtogroup bdb
  27. * @{
  28. */
  29. /*! \file
  30. * Berkeley DB :
  31. * Implementation of bdb_fld data structure representing BDB fields and
  32. * related functions.
  33. *
  34. * \ingroup database
  35. */
  36. #include <db.h>
  37. #include "../../lib/srdb2/db_gen.h"
  38. #include "../../lib/srdb2/db_fld.h"
  39. typedef struct _bdb_fld {
  40. db_drv_t gen;
  41. char* name;
  42. int is_null;
  43. unsigned long length;
  44. str buf;
  45. int col_pos;
  46. } bdb_fld_t, *bdb_fld_p;
  47. /** Creates a new BDB specific payload.
  48. * This function creates a new BDB specific payload structure and
  49. * attaches the structure to the generic db_fld structure.
  50. * @param fld A generic db_fld structure to be exended.
  51. * @param table Name of the table on the server.
  52. * @retval 0 on success.
  53. * @retval A negative number on error.
  54. */
  55. int bdb_fld(db_fld_t* fld, char* table);
  56. /** @} */
  57. #endif /* _BDB_FLD_H_ */