dbtext.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * $Id$
  3. *
  4. * DBText module core functions
  5. *
  6. * Copyright (C) 2001-2003 FhG Fokus
  7. *
  8. * This file is part of Kamailio, a free SIP server.
  9. *
  10. * Kamailio 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. * Kamailio 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. * 2003-01-30 created by Daniel
  27. *
  28. */
  29. #ifndef _DBTEXT_H_
  30. #define _DBTEXT_H_
  31. #include "../../lib/srdb1/db_con.h"
  32. #include "../../lib/srdb1/db_res.h"
  33. #include "../../lib/srdb1/db_key.h"
  34. #include "../../lib/srdb1/db_op.h"
  35. #include "../../lib/srdb1/db_val.h"
  36. /*
  37. * Initialize database connection
  38. */
  39. db1_con_t* dbt_init(const str* _sqlurl);
  40. /*
  41. * Close a database connection
  42. */
  43. void dbt_close(db1_con_t* _h);
  44. /*
  45. * Free all memory allocated by get_result
  46. */
  47. int dbt_free_result(db1_con_t* _h, db1_res_t* _r);
  48. /*
  49. * Do a query
  50. */
  51. int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v,
  52. db_key_t* _c, int _n, int _nc, db_key_t _o, db1_res_t** _r);
  53. /*
  54. * Raw SQL query
  55. */
  56. int dbt_raw_query(db1_con_t* _h, char* _s, db1_res_t** _r);
  57. /*
  58. * Insert a row into table
  59. */
  60. int dbt_insert(db1_con_t* _h, db_key_t* _k, db_val_t* _v, int _n);
  61. /*
  62. * Delete a row from table
  63. */
  64. int dbt_delete(db1_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _v, int _n);
  65. /*
  66. * Update a row in table
  67. */
  68. int dbt_update(db1_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _v,
  69. db_key_t* _uk, db_val_t* _uv, int _n, int _un);
  70. #endif