2
0

ul_db_api.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #include "ul_db_api.h"
  22. #include "../../sr_module.h"
  23. int bind_ul_db(ul_db_api_t* api)
  24. {
  25. if (!api) {
  26. LM_ERR("invalid parameter value\n");
  27. return -1;
  28. }
  29. api->insert = (ul_db_insert_t) ul_db_insert;
  30. if(api->insert == 0){
  31. LM_ERR("can't bind ul_db_insert\n");
  32. return -1;
  33. }
  34. api->update = (ul_db_update_t) ul_db_update;
  35. if(api->update == 0){
  36. LM_ERR("can't bind ul_db_update\n");
  37. return -1;
  38. }
  39. api->replace = (ul_db_replace_t) ul_db_replace;
  40. if(api->replace == 0){
  41. LM_ERR("can't bind ul_db_replace\n");
  42. return -1;
  43. }
  44. api->delete = (ul_db_delete_t) ul_db_delete;
  45. if(api->delete == 0){
  46. LM_ERR("can't bind ul_db_delete\n");
  47. return -1;
  48. }
  49. api->query = (ul_db_query_t) ul_db_query;
  50. if(api->query == 0){
  51. LM_ERR("can't bind ul_db_query\n");
  52. return -1;
  53. }
  54. api->free_result = (ul_db_free_result_t) ul_db_free_result;
  55. if(api->free_result == 0){
  56. LM_ERR("can't bind ul_db_free_result\n");
  57. return -1;
  58. }
  59. return 0;
  60. }