km_bdb_res.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * $Id$
  3. *
  4. * sleepycat module, portions of this code were templated using
  5. * the dbtext and postgres modules.
  6. * Copyright (C) 2007 Cisco Systems
  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
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version
  14. *
  15. * SIP-router is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * History:
  25. * --------
  26. * 2007-09-19 genesis (wiquan)
  27. */
  28. /*! \file
  29. * Berkeley DB :
  30. *
  31. * \ingroup database
  32. */
  33. #ifndef _KM_BDB_RES_H_
  34. #define _KM_BDB_RES_H_
  35. #include "../../lib/srdb1/db_op.h"
  36. #include "../../lib/srdb1/db_res.h"
  37. #include "../../lib/srdb1/db_con.h"
  38. #include "km_bdb_lib.h"
  39. #include "km_bdb_val.h"
  40. typedef struct _con
  41. {
  42. database_p con;
  43. db1_res_t* res;
  44. row_p row;
  45. } bdb_con_t, *bdb_con_p;
  46. #define BDB_CON_CONNECTION(db_con) (((bdb_con_p)((db_con)->tail))->con)
  47. #define BDB_CON_RESULT(db_con) (((bdb_con_p)((db_con)->tail))->res)
  48. #define BDB_CON_ROW(db_con) (((bdb_con_p)((db_con)->tail))->row)
  49. int bdb_get_columns(table_p _tp, db1_res_t* _res, int* _lres, int _nc);
  50. int bdb_convert_row( db1_res_t* _res, char *bdb_result, int* _lres);
  51. int bdb_append_row(db1_res_t* _res, char *bdb_result, int* _lres, int _rx);
  52. int* bdb_get_colmap(table_p _tp, db_key_t* _k, int _n);
  53. int bdb_is_neq_type(db_type_t _t0, db_type_t _t1);
  54. int bdb_row_match(db_key_t* _k, db_op_t* _op, db_val_t* _v, int _n, db1_res_t* _r, int* lkey );
  55. int bdb_cmp_val(db_val_t* _vp, db_val_t* _v);
  56. #endif