2
0

api.h 621 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * $Id$
  3. *
  4. */
  5. #ifndef _MSILO_API_H_
  6. #define _MSILO_API_H_
  7. //#include "../../sr_module.h"
  8. typedef int (*msilo_f)(struct sip_msg*, str*);
  9. typedef struct msilo_api {
  10. msilo_f m_store;
  11. msilo_f m_dump;
  12. } msilo_api_t;
  13. typedef int (*bind_msilo_f)(msilo_api_t* api);
  14. /**
  15. * @brief Load the MSILO API
  16. */
  17. static inline int load_msilo_api(msilo_api_t *api)
  18. {
  19. bind_msilo_f bindmsilo;
  20. bindmsilo = (bind_msilo_f)find_export("bind_msilo", 1, 0);
  21. if(bindmsilo == 0) {
  22. LM_ERR("cannot find bind_msilo\n");
  23. return -1;
  24. }
  25. if(bindmsilo(api)<0)
  26. {
  27. LM_ERR("cannot bind msilo api\n");
  28. return -1;
  29. }
  30. return 0;
  31. }
  32. #endif