k/msilo/api.h

00001 
00006 #ifndef _MSILO_API_H_
00007 #define _MSILO_API_H_
00008 
00009 //#include "../../sr_module.h"
00010 
00011 typedef int (*msilo_f)(struct sip_msg*, str*);
00012 typedef struct msilo_api {
00013         msilo_f m_store;
00014         msilo_f m_dump;
00015 } msilo_api_t;
00016 
00017 typedef int (*bind_msilo_f)(msilo_api_t* api);
00018 
00022 static inline int load_msilo_api(msilo_api_t *api)
00023 {
00024         bind_msilo_f bindmsilo;
00025 
00026         bindmsilo = (bind_msilo_f)find_export("bind_msilo", 1, 0);
00027         if(bindmsilo == 0) {
00028                 LM_ERR("cannot find bind_msilo\n");
00029                 return -1;
00030         }
00031         if(bindmsilo(api)<0)
00032         {
00033                 LM_ERR("cannot bind msilo api\n");
00034                 return -1;
00035         }
00036         return 0;
00037 }
00038 
00039 #endif