api.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is part of kamailio, a free SIP server.
  3. *
  4. * kamailio is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * kamailio is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. */
  19. #ifndef TEXTOPSX_API_H_
  20. #define TEXTOPSX_API_H_
  21. #include "../../str.h"
  22. #include "../../sr_module.h"
  23. /*
  24. * Struct with the textopsx api.
  25. */
  26. typedef struct textopsx_binds {
  27. cmd_function msg_apply_changes;
  28. } textopsx_api_t;
  29. typedef int (*bind_textopsx_f)(textopsx_api_t*);
  30. /*
  31. * Function to be called direclty from other modules to load
  32. * the textops API.
  33. */
  34. inline static int load_textopsx_api(textopsx_api_t *tob){
  35. bind_textopsx_f bind_textopsx_exports;
  36. if(!(bind_textopsx_exports=(bind_textopsx_f)find_export("bind_textopsx", 1, 0))){
  37. LM_ERR("Failed to import bind_textopsx\n");
  38. return -1;
  39. }
  40. return bind_textopsx_exports(tob);
  41. }
  42. #endif /*TEXTX_OPS_API_H_*/