Skip to content

Commit

Permalink
dispatcher: use clang format across the module
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jan 10, 2017
1 parent 57a81bb commit d081ee4
Show file tree
Hide file tree
Showing 8 changed files with 1,105 additions and 1,338 deletions.
13 changes: 6 additions & 7 deletions src/modules/dispatcher/api.h
Expand Up @@ -31,22 +31,23 @@

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

typedef int (*ds_select_dst_f)(struct sip_msg *msg, int set,
int alg, int mode);
typedef int (*ds_select_dst_f)(struct sip_msg *msg, int set, int alg, int mode);
typedef int (*ds_next_dst_f)(struct sip_msg *msg, int mode);
typedef int (*ds_mark_dst_f)(struct sip_msg *msg, int mode);

typedef int (*ds_is_from_list_f)(struct sip_msg *_m, int group);

/* clang-format off */
typedef struct dispatcher_api {
ds_select_dst_f select;
ds_next_dst_f next;
ds_mark_dst_f mark;
ds_is_from_list_f is_from;
} dispatcher_api_t;
/* clang-format on */

typedef int (*bind_dispatcher_f)(dispatcher_api_t* api);
int bind_dispatcher(dispatcher_api_t* api);
typedef int (*bind_dispatcher_f)(dispatcher_api_t *api);
int bind_dispatcher(dispatcher_api_t *api);

/**
* @brief Load the dispatcher API
Expand All @@ -60,8 +61,7 @@ static inline int dispatcher_load_api(dispatcher_api_t *api)
LM_ERR("cannot find bind_dispatcher\n");
return -1;
}
if(binddispatcher(api)<0)
{
if(binddispatcher(api) < 0) {
LM_ERR("cannot bind dispatcher api\n");
return -1;
}
Expand All @@ -70,4 +70,3 @@ static inline int dispatcher_load_api(dispatcher_api_t *api)


#endif

12 changes: 7 additions & 5 deletions src/modules/dispatcher/config.c
Expand Up @@ -18,7 +18,7 @@
*/

/*!
* \file
* \file
* \brief Dispatcher :: Configuration
* \ingroup Dispatcher
*/
Expand All @@ -29,11 +29,12 @@

#include "config.h"

/* clang-format off */
struct cfg_group_dispatcher default_dispatcher_cfg = {
1, /* Probing threshold */
1, /* Inactive threshold */
{0,0} /* reply codes */
};
1, /* Probing threshold */
1, /* Inactive threshold */
{0,0} /* reply codes */
};

void *dispatcher_cfg = &default_dispatcher_cfg;

Expand All @@ -49,3 +50,4 @@ cfg_def_t dispatcher_cfg_def[] = {
"Additional, valid reply codes for the OPTIONS Pinger. Default is \"\""},
{0, 0, 0, 0, 0, 0}
};
/* clang-format on */
11 changes: 6 additions & 5 deletions src/modules/dispatcher/config.h
Expand Up @@ -31,16 +31,17 @@
#include "../../core/cfg/cfg.h"
#include "../../core/str.h"

struct cfg_group_dispatcher {
struct cfg_group_dispatcher
{
int probing_threshold;
int inactive_threshold;
str ds_ping_reply_codes_str;
};

extern struct cfg_group_dispatcher default_dispatcher_cfg;
extern void *dispatcher_cfg;
extern cfg_def_t dispatcher_cfg_def[];
extern struct cfg_group_dispatcher default_dispatcher_cfg;
extern void *dispatcher_cfg;
extern cfg_def_t dispatcher_cfg_def[];

extern void ds_ping_reply_codes_update(str*, str*);
extern void ds_ping_reply_codes_update(str *, str *);

#endif

0 comments on commit d081ee4

Please sign in to comment.