Skip to content

Commit

Permalink
rr: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 4f2523f commit 4b12045
Show file tree
Hide file tree
Showing 9 changed files with 907 additions and 849 deletions.
16 changes: 8 additions & 8 deletions src/modules/rr/api.c
Expand Up @@ -52,18 +52,18 @@ extern int append_fromtag;
* \param rrb record-route API export binding
* \return 1
*/
int load_rr( struct rr_binds *rrb )
int load_rr(struct rr_binds *rrb)
{
rrb->record_route_preset = record_route_preset;
rrb->record_route_advertised_address = record_route_advertised_address;
rrb->record_route = record_route;
rrb->loose_route = loose_route;
rrb->add_rr_param = add_rr_param;
rrb->record_route = record_route;
rrb->loose_route = loose_route;
rrb->add_rr_param = add_rr_param;
rrb->check_route_param = check_route_param;
rrb->is_direction = is_direction;
rrb->get_route_param = get_route_param;
rrb->register_rrcb = register_rrcb;
rrb->append_fromtag = append_fromtag;
rrb->is_direction = is_direction;
rrb->get_route_param = get_route_param;
rrb->register_rrcb = register_rrcb;
rrb->append_fromtag = append_fromtag;

return 1;
}
47 changes: 24 additions & 23 deletions src/modules/rr/api.h
Expand Up @@ -44,61 +44,62 @@
#include "loose.h"
#include "rr_cb.h"

typedef int (*add_rr_param_t)(struct sip_msg*, str*);
typedef int (*check_route_param_t)(struct sip_msg*, regex_t*);
typedef int (*is_direction_t)(struct sip_msg*, int);
typedef int (*get_route_param_t)(struct sip_msg*, str*, str*);
typedef int (*record_route_f)(struct sip_msg*, str*);
typedef int (*loose_route_f)(struct sip_msg*);
typedef int (*add_rr_param_t)(struct sip_msg *, str *);
typedef int (*check_route_param_t)(struct sip_msg *, regex_t *);
typedef int (*is_direction_t)(struct sip_msg *, int);
typedef int (*get_route_param_t)(struct sip_msg *, str *, str *);
typedef int (*record_route_f)(struct sip_msg *, str *);
typedef int (*loose_route_f)(struct sip_msg *);

/*! record-route API export binding */
typedef struct rr_binds {
record_route_f record_route;
record_route_f record_route_preset;
record_route_f record_route_advertised_address;
loose_route_f loose_route;
add_rr_param_t add_rr_param;
check_route_param_t check_route_param;
is_direction_t is_direction;
get_route_param_t get_route_param;
register_rrcb_t register_rrcb;
int append_fromtag;
typedef struct rr_binds
{
record_route_f record_route;
record_route_f record_route_preset;
record_route_f record_route_advertised_address;
loose_route_f loose_route;
add_rr_param_t add_rr_param;
check_route_param_t check_route_param;
is_direction_t is_direction;
get_route_param_t get_route_param;
register_rrcb_t register_rrcb;
int append_fromtag;
} rr_api_t;

typedef int (*load_rr_f)( struct rr_binds* );
typedef int (*load_rr_f)(struct rr_binds *);

/*!
* \brief API bind function exported by the module - it will load the other functions
* \param rrb record-route API export binding
* \return 1
*/
int load_rr( struct rr_binds *rrb );
int load_rr(struct rr_binds *rrb);


/*!
* \brief Function to be called directly from other modules to load the RR API
* \param rrb record-route API export binding
* \return 0 on success, -1 if the API loader could not imported
*/
inline static int load_rr_api( struct rr_binds *rrb )
inline static int load_rr_api(struct rr_binds *rrb)
{
load_rr_f load_rr_v;

/* import the RR auto-loading function */
if ( !(load_rr_v=(load_rr_f)find_export("load_rr", 0, 0))) {
if(!(load_rr_v = (load_rr_f)find_export("load_rr", 0, 0))) {
LM_ERR("failed to import load_rr\n");
return -1;
}
/* let the auto-loading function load all RR stuff */
load_rr_v( rrb );
load_rr_v(rrb);

return 0;
}

/**
*
*/
inline static int rr_load_api( rr_api_t *rrb )
inline static int rr_load_api(rr_api_t *rrb)
{
return load_rr_api(rrb);
}
Expand Down

0 comments on commit 4b12045

Please sign in to comment.