dbase.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * $Id$
  3. *
  4. * Oracle module core functions
  5. *
  6. * Copyright (C) 2007,2008 TRUNK MOBILE
  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. #ifndef DBASE_H
  25. #define DBASE_H
  26. #include "../../lib/srdb1/db_con.h"
  27. #include "../../lib/srdb1/db_res.h"
  28. #include "../../lib/srdb1/db_key.h"
  29. #include "../../lib/srdb1/db_op.h"
  30. #include "../../lib/srdb1/db_val.h"
  31. /*
  32. * Initialize database connection
  33. */
  34. db1_con_t* db_oracle_init(const str* _sqlurl);
  35. /*
  36. * Close a database connection
  37. */
  38. void db_oracle_close(db1_con_t* _h);
  39. /*
  40. * Free all memory allocated by get_result
  41. */
  42. int db_oracle_free_result(db1_con_t* _h, db1_res_t* _r);
  43. /*
  44. * Do a query
  45. */
  46. int db_oracle_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
  47. const db_val_t* _v, const db_key_t* _c, int _n, int _nc,
  48. const db_key_t _o, db1_res_t** _r);
  49. /*
  50. * Raw SQL query
  51. */
  52. int db_oracle_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
  53. /*
  54. * Insert a row into table
  55. */
  56. int db_oracle_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
  57. int _n);
  58. /*
  59. * Delete a row from table
  60. */
  61. int db_oracle_delete(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
  62. const db_val_t* _v, int _n);
  63. /*
  64. * Update a row in table
  65. */
  66. int db_oracle_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
  67. const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv,
  68. int _n, int _un);
  69. /*
  70. * Store name of table that will be used by
  71. * subsequent database functions
  72. */
  73. int db_oracle_use_table(db1_con_t* _h, const str* _t);
  74. /*
  75. * Make error message. Always return negative value
  76. */
  77. int sql_buf_small(void);
  78. #endif /* DBASE_H */