whitespace fixes only

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Michiel van Baak 17 years ago
parent d251bacacc
commit 408497916b

@ -36,7 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <netinet/in.h>
#include <ctype.h>
#include "asterisk/paths.h" /* use ast_config_AST_CONFIG_DIR */
#include "asterisk/paths.h" /* use ast_config_AST_CONFIG_DIR */
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
@ -94,25 +94,25 @@ static struct adsi_event justify[] = {
{ 3, "INDENT" },
};
#define STATE_NORMAL 0
#define STATE_INKEY 1
#define STATE_INSUB 2
#define STATE_INIF 3
#define STATE_NORMAL 0
#define STATE_INKEY 1
#define STATE_INSUB 2
#define STATE_INIF 3
#define MAX_RET_CODE 20
#define MAX_SUB_LEN 255
#define MAX_MAIN_LEN 1600
#define MAX_RET_CODE 20
#define MAX_SUB_LEN 255
#define MAX_MAIN_LEN 1600
#define ARG_STRING (1 << 0)
#define ARG_NUMBER (1 << 1)
#define ARG_STRING (1 << 0)
#define ARG_NUMBER (1 << 1)
struct adsi_soft_key {
char vname[40]; /* Which "variable" is associated with it */
int retstrlen; /* Length of return string */
int initlen; /* initial length */
char vname[40]; /* Which "variable" is associated with it */
int retstrlen; /* Length of return string */
int initlen; /* initial length */
int id;
int defined;
char retstr[80]; /* Return string data */
char retstr[80]; /* Return string data */
};
struct adsi_subscript {
@ -267,7 +267,7 @@ static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_scri
a = dtmfstr;
while(*a) {
while (*a) {
if (strchr(validdtmf, *a)) {
*buf = *a;
buf++;
@ -292,11 +292,11 @@ static int goto_line(char *buf, char *name, int id, char *args, struct adsi_scri
return 0;
}
if (!strcasecmp(page, "INFO")) {
if (!strcasecmp(page, "INFO"))
cmd = 0;
} else if (!strcasecmp(page, "COMM")) {
else if (!strcasecmp(page, "COMM"))
cmd = 0x80;
} else {
else {
ast_log(LOG_WARNING, "Expecting either 'INFO' or 'COMM' page, got got '%s' at line %d of %s\n", page, lineno, script);
return 0;
}
@ -325,11 +325,11 @@ static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_
return 0;
}
if (!strcasecmp(dir, "UP")) {
if (!strcasecmp(dir, "UP"))
cmd = 0;
} else if (!strcasecmp(dir, "DOWN")) {
else if (!strcasecmp(dir, "DOWN"))
cmd = 0x20;
} else {
else {
ast_log(LOG_WARNING, "Expecting either 'UP' or 'DOWN' direction, got '%s' at line %d of %s\n", dir, lineno, script);
return 0;
}
@ -641,13 +641,13 @@ static int showkeys(char *buf, char *name, int id, char *args, struct adsi_scrip
break;
if (!strcasecmp(tok, "UNLESS")) {
/* Check for trailing UNLESS flag */
if (!(tok = get_token(&args, script, lineno))) {
if (!(tok = get_token(&args, script, lineno)))
ast_log(LOG_WARNING, "Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
} else if (process_token(newkey, tok, sizeof(newkey) - 1, ARG_STRING)) {
else if (process_token(newkey, tok, sizeof(newkey) - 1, ARG_STRING))
ast_log(LOG_WARNING, "Invalid flag name '%s' at line %d of %s\n", tok, lineno, script);
} else if (!(flag = getflagbyname(state, newkey, script, lineno, 0))) {
else if (!(flag = getflagbyname(state, newkey, script, lineno, 0)))
ast_log(LOG_WARNING, "Flag '%s' is undeclared at line %d of %s\n", newkey, lineno, script);
} else
else
flagid = flag->id;
if ((tok = get_token(&args, script, lineno)))
ast_log(LOG_WARNING, "Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
@ -668,9 +668,9 @@ static int showkeys(char *buf, char *name, int id, char *args, struct adsi_scrip
}
buf[0] = id;
buf[1] = (flagid & 0x7) << 3 | (x & 0x7);
for (bytes = 0; bytes < x; bytes++) {
for (bytes = 0; bytes < x; bytes++)
buf[bytes + 2] = keyid[bytes];
}
return 2 + x;
}
@ -709,11 +709,11 @@ static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_sc
if (tok && !strcasecmp(tok, "UNLESS")) {
/* Check for trailing UNLESS flag */
if (!(tok = get_token(&args, script, lineno))) {
if (!(tok = get_token(&args, script, lineno)))
ast_log(LOG_WARNING, "Missing argument for UNLESS clause at line %d of %s\n", lineno, script);
} else if (process_token(&flag, tok, sizeof(flag), ARG_NUMBER)) {
else if (process_token(&flag, tok, sizeof(flag), ARG_NUMBER))
ast_log(LOG_WARNING, "Invalid flag number '%s' at line %d of %s\n", tok, lineno, script);
}
if ((tok = get_token(&args, script, lineno)))
ast_log(LOG_WARNING, "Extra arguments after UNLESS clause: '%s' at line %d of %s\n", tok, lineno, script);
}
@ -816,8 +816,7 @@ static int onevent(char *buf, char *name, int id, char *args, struct adsi_script
}
tok = get_token(&args, script, lineno);
while ((!sawin && !strcasecmp(tok, "IN")) ||
(sawin && !strcasecmp(tok, "OR"))) {
while ((!sawin && !strcasecmp(tok, "IN")) || (sawin && !strcasecmp(tok, "OR"))) {
sawin = 1;
if (scnt > 7) {
ast_log(LOG_WARNING, "No more than 8 states may be specified for inclusion at line %d of %s\n", lineno, script);
@ -1141,7 +1140,7 @@ static int adsi_process(struct adsi_script *state, char *buf, char *script, int
break;
}
state->state = STATE_INSUB;
} else if (!strcasecmp(keyword, "STATE")) {
} else if (!strcasecmp(keyword, "STATE")) {
if (!(args = get_token(&buf, script, lineno))) {
ast_log(LOG_WARNING, "STATE definition missing name at line %d of %s\n", lineno, script);
break;
@ -1155,7 +1154,7 @@ static int adsi_process(struct adsi_script *state, char *buf, char *script, int
break;
}
getstatebyname(state, vname, script, lineno, 1);
} else if (!strcasecmp(keyword, "FLAG")) {
} else if (!strcasecmp(keyword, "FLAG")) {
if (!(args = get_token(&buf, script, lineno))) {
ast_log(LOG_WARNING, "FLAG definition missing name at line %d of %s\n", lineno, script);
break;
@ -1217,7 +1216,7 @@ static int adsi_process(struct adsi_script *state, char *buf, char *script, int
disp->datalen += strlen(tmp);
args = get_token(&buf, script, lineno);
}
while(args) {
while (args) {
if (!strcasecmp(args, "JUSTIFY")) {
args = get_token(&buf, script, lineno);
if (!args) {
@ -1324,8 +1323,7 @@ static int adsi_process(struct adsi_script *state, char *buf, char *script, int
break;
}
state->sub->ifinscount = 0;
state->sub->ifdata = state->sub->data +
state->sub->datalen;
state->sub->ifdata = state->sub->data + state->sub->datalen;
/* Reserve header and insert op codes */
state->sub->ifdata[0] = 0x1;
state->sub->ifdata[1] = event;
@ -1370,7 +1368,7 @@ static struct adsi_script *compile_script(char *script)
/* Create "main" as first subroutine */
getsubbyname(scr, "main", NULL, 0);
while(!feof(f)) {
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
if (!feof(f)) {
lineno++;
@ -1531,7 +1529,6 @@ static int adsi_prog(struct ast_channel *chan, char *script)
}
}
bytes = 0;
bytes += ast_adsi_display(buf, ADSI_INFO_PAGE, 1, ADSI_JUST_LEFT, 0, "Download complete.", "");
bytes += ast_adsi_set_line(buf, ADSI_INFO_PAGE, 1);

Loading…
Cancel
Save