k/pua_usrloc/api.h

00001 #ifndef PUAUSRLOC_API_H
00002 #define PUAUSRLOC_API_H
00003 #include "../../str.h"
00004 
00005 typedef int (*pua_set_publish_t)(struct sip_msg*, char *, char *);
00006 
00007 typedef struct pua_usrloc_binds {
00008         pua_set_publish_t pua_set_publish;
00009 } pua_usrloc_api_t;
00010 
00011 typedef int (*bind_pua_usrloc_f)(pua_usrloc_api_t*);
00012 
00013 int bind_pua_usrloc(struct pua_usrloc_binds*);
00014 
00015 inline static int pua_usrloc_load_api(pua_usrloc_api_t *pxb)
00016 {
00017         bind_pua_usrloc_f bind_pua_usrloc_exports;
00018         if (!(bind_pua_usrloc_exports = (bind_pua_usrloc_f)find_export("bind_pua_usrloc", 1, 0)))
00019         {
00020                 LM_ERR("Failed to import bind_pua_usrloc\n");
00021                 return -1;
00022         }
00023         return bind_pua_usrloc_exports(pxb);
00024 }
00025 
00026 #endif /*PUAUSRLOC_API_H*/