/* Copy HA structure */
static void ast_copy_ha(struct ast_ha *from, struct ast_ha *to)
- {
-
- memcpy(&to->netaddr, &from->netaddr, sizeof(from->netaddr));
- memcpy(&to->netmask, &from->netmask, sizeof(from->netmask));
- to->sense = from->sense;
-
- }
+{
+ memcpy(&to->netaddr, &from->netaddr, sizeof(from->netaddr));
+ memcpy(&to->netmask, &from->netmask, sizeof(from->netmask));
+ to->sense = from->sense;
+}
/* Create duplicate of ha structure */
static struct ast_ha *ast_duplicate_ha(struct ast_ha *original)
if (!ret)
ret = link; /* Save starting point */
- start = start->next; /* Go to next object */
- prev = link; /* Save pointer to this object */
- }
- return (ret); /* Return start of list */
+ start = start->next; /* Go to next object */
+ prev = link; /* Save pointer to this object */
+ }
+ return (ret); /* Return start of list */
}
-
struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
{
struct ast_ha *ha = malloc(sizeof(struct ast_ha));
}
void ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr) {
- if(cdr) {
+ if (cdr) {
while(cdr->next)
cdr = cdr->next;
cdr->next = newcdr;
- } else
- ast_log(LOG_ERROR, "Can't append a CDR to NULL!\n");
-
+ } else
+ ast_log(LOG_ERROR, "Can't append a CDR to NULL!\n");
}
void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset)
{
-time_t myt;
+ time_t myt;
time(&myt);
- if (offset)
- chan->whentohangup = myt + offset;
- else
- chan->whentohangup = 0;
+ if (offset)
+ chan->whentohangup = myt + offset;
+ else
+ chan->whentohangup = 0;
return;
}
int ast_channel_register(char *type, char *description, int capabilities,
struct ast_channel *(*requester)(char *type, int format, void *data))
{
- return ast_channel_register_ex(type, description, capabilities, requester, NULL);
+ return ast_channel_register_ex(type, description, capabilities, requester, NULL);
}
int ast_channel_register_ex(char *type, char *description, int capabilities,
return -1;
}
chan = backends;
- while(chan) {
+ while (chan) {
if (!strcasecmp(type, chan->type)) {
ast_log(LOG_WARNING, "Already have a handler for type '%s'\n", type);
ast_mutex_unlock(&chlock);
ast_mutex_unlock(&chan->lock);
manager_event(EVENT_FLAG_CALL, "Hangup",
"Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Cause: %i\r\n",
- chan->name, chan->uniqueid, chan->hangupcause);
+ "Uniqueid: %s\r\n"
+ "Cause: %i\r\n",
+ chan->name, chan->uniqueid, chan->hangupcause);
ast_channel_free(chan);
return res;
}
char *cur;
char *arg=NULL;
struct ast_config_reg *reg=NULL;
- struct ast_config *(*load_func)(char *, struct ast_config *,struct ast_category **,struct ast_variable **,int
+ struct ast_config *(*load_func)(char *, struct ast_config *,struct ast_category **,struct ast_variable **,int
#ifdef PRESERVE_COMMENTS
,struct ast_comment_struct *
#endif
-);
-
+ );
struct ast_variable *v;
#ifdef PRESERVE_COMMENTS
struct ast_comment *com = NULL;
int res;
int x;
- h = (dns_HEADER *)answer;
+ h = (dns_HEADER *)answer;
answer += sizeof(dns_HEADER);
len -= sizeof(dns_HEADER);
"undefined", /* 13 */
"undefined", /* 14 */
"Maximum audio format", /* 15 */
- /* Image formats */
+ /* Image formats */
"JPEG image", /* 16 */
"PNG image", /* 17 */
"H.261 Video", /* 18 */
"undefined", /* 21 */
"undefined", /* 22 */
"undefined", /* 23 */
- "Maximum video format", /* 24 */
+ "Maximum video format", /* 24 */
};
if ((codec >= 0) && (codec <= 24))
return codecs[codec];
else
separator = ",";
s = strsep(&stringp,separator);
- while(s && *s) {
+ while (s && *s) {
int freq1, freq2, time, modulate=0;
if (s[0]=='!')
if (!ast_strlen_zero(c->host))
return 1;
- return 0;
+ return 0;
}
int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, const char *service)
if (ret <= 0) {
strcpy(host, "");
- *port = -1;
+ *port = -1;
return ret;
}
return ret;
static int show_translation(int fd, int argc, char *argv[])
{
#define SHOW_TRANS 11
- int x,y,z;
+ int x, y, z;
char line[80];
if (argc > 4)
return RESULT_SHOWUSAGE;
- if(argv[2] && !strcasecmp(argv[2],"recalc")) {
- z = argv[3] ? atoi(argv[3]) : 1;
+ if (argv[2] && !strcasecmp(argv[2],"recalc")) {
+ z = argv[3] ? atoi(argv[3]) : 1;
- if(z <= 0) {
- ast_cli(fd," C'mon let's be serious here... defaulting to 1.\n");
- z = 1;
- }
-
- if(z > MAX_RECALC) {
- ast_cli(fd," Maximum limit of recalc exceeded by %d, truncating value to %d\n",z-MAX_RECALC,MAX_RECALC);
- z = MAX_RECALC;
- }
- ast_cli(fd," Recalculating Codec Translation (number of sample seconds: %d)\n\n",z);
- rebuild_matrix(z);
+ if (z <= 0) {
+ ast_cli(fd," C'mon let's be serious here... defaulting to 1.\n");
+ z = 1;
+ }
+ if (z > MAX_RECALC) {
+ ast_cli(fd," Maximum limit of recalc exceeded by %d, truncating value to %d\n",z-MAX_RECALC,MAX_RECALC);
+ z = MAX_RECALC;
+ }
+ ast_cli(fd," Recalculating Codec Translation (number of sample seconds: %d)\n\n",z);
+ rebuild_matrix(z);
}
ast_cli(fd, " Translation times between formats (in milliseconds)\n");
AST_MUTEX_DEFINE_STATIC(__mutex);
static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
- size_t buflen, struct hostent **result,
- int *h_errnop)
+ size_t buflen, struct hostent **result,
+ int *h_errnop)
{
int hsave;
struct hostent *ph;