Skip to content

Commit

Permalink
proto_msrp: provide API loading function
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu committed Mar 8, 2022
1 parent a8f964c commit 3ee9a2f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/proto_msrp/msrp_api.h
Expand Up @@ -22,6 +22,8 @@
#ifndef _PROTO_MSRP_MSRP_API_H_
#define _PROTO_MSRP_MSRP_API_H_

#include "../../sr_module.h"

#include "msrp_parser.h"
#include "msrp_handler.h"

Expand Down Expand Up @@ -49,4 +51,19 @@ struct msrp_binds {

void load_msrp( struct msrp_binds *binds);

typedef void (*load_msrp_f)(struct msrp_binds *binds);

static inline int load_msrp_api(struct msrp_binds *binds) {
load_msrp_f load_msrp;

/* import the msrp auto-loading function */
if (!(load_msrp = (load_msrp_f) find_export("load_msrp", 0)))
return -1;

/* let the auto-loading function load all msrp API functions */
load_msrp(binds);

return 0;
}

#endif

0 comments on commit 3ee9a2f

Please sign in to comment.