ul_db_api.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* sp-ul_db module
  2. *
  3. * Copyright (C) 2007 1&1 Internet AG
  4. *
  5. * This file is part of Kamailio, a free SIP server.
  6. *
  7. * Kamailio is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version
  11. *
  12. * Kamailio is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef UL_DB_API_H
  22. #define UL_DB_API_H
  23. #include "ul_db.h"
  24. #include "../../sr_module.h"
  25. typedef int (* ul_db_insert_t) (str * table, str * first, str * second,
  26. db_key_t* _k, db_val_t* _v, int _n);
  27. typedef int (* ul_db_update_t) (str * table, str * first, str * second,
  28. db_key_t* _k, db_op_t * _op, db_val_t* _v, db_key_t* _uk,
  29. db_val_t* _uv, int _n, int _un);
  30. typedef int (* ul_db_insert_update_t) (str * table, str * first, str * second,
  31. db_key_t* _k, db_val_t* _v, int _n);
  32. typedef int (* ul_db_replace_t) (str * table, str * first, str * second,
  33. db_key_t* _k, db_val_t* _v, int _n, int _un);
  34. typedef int (* ul_db_delete_t) (str * table, str * first, str * second,
  35. db_key_t* _k, db_op_t* _o, db_val_t* _v, int _n);
  36. typedef int (* ul_db_query_t) (str * table, str * first, str * second, db1_con_t *** _r_h,
  37. db_key_t* _k, db_op_t* _op, db_val_t* _v, db_key_t* _c,
  38. int _n, int _nc, db_key_t _o, db1_res_t** _r);
  39. typedef int (* ul_db_free_result_t)(db1_con_t ** dbh, db1_res_t * res);
  40. typedef struct ul_db_api{
  41. ul_db_update_t update;
  42. ul_db_insert_t insert;
  43. ul_db_insert_update_t insert_update;
  44. ul_db_replace_t replace;
  45. ul_db_delete_t delete;
  46. ul_db_query_t query;
  47. ul_db_free_result_t free_result;
  48. }ul_db_api_t;
  49. typedef int (*bind_ul_db_t)(ul_db_api_t * api);
  50. int bind_ul_db(ul_db_api_t* api);
  51. #endif