Skip to content

Commit

Permalink
usrloc API: Add a loading function
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Dec 5, 2016
1 parent 968c1ba commit 8ec91e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/usrloc/usrloc.h
Expand Up @@ -68,5 +68,20 @@ typedef struct usrloc_api {

typedef int (*bind_usrloc_t)(usrloc_api_t* api);

static inline int load_ul_api(usrloc_api_t *ul)
{
bind_usrloc_t bind_usrloc;

bind_usrloc = (bind_usrloc_t)find_export("ul_bind_usrloc", 1, 0);
if (!bind_usrloc) {
LM_ERR("can't bind usrloc\n");
return -1;
}

if (bind_usrloc(ul) < 0)
return -1;

return 0;
}

#endif /* USRLOC_H */

0 comments on commit 8ec91e5

Please sign in to comment.