[asterisk-commits] twilson: trunk r156918 - /trunk/res/res_phoneprov.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Nov 14 11:35:34 CST 2008
Author: twilson
Date: Fri Nov 14 11:35:33 2008
New Revision: 156918
URL: http://svn.digium.com/view/asterisk?view=rev&rev=156918
Log:
Cleanup whitespace issues
Modified:
trunk/res/res_phoneprov.c
Modified: trunk/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_phoneprov.c?view=diff&rev=156918&r1=156917&r2=156918
==============================================================================
--- trunk/res/res_phoneprov.c (original)
+++ trunk/res/res_phoneprov.c Fri Nov 14 11:35:33 2008
@@ -170,7 +170,7 @@
static char global_server[80] = ""; /*!< Server to substitute into templates */
static char global_serverport[6] = ""; /*!< Server port to substitute into templates */
-static char global_default_profile[80] = ""; /*!< Default profile to use if one isn't specified */
+static char global_default_profile[80] = ""; /*!< Default profile to use if one isn't specified */
/*! \brief List of global variables currently available: VOICEMAIL_EXTEN, EXTENSION_LENGTH */
static struct varshead global_variables;
@@ -188,7 +188,7 @@
if (!strcasecmp(ftype, mimetypes[x].ext))
return mimetypes[x].mtype;
}
-
+
return NULL;
}
@@ -243,7 +243,7 @@
static int profile_hash_fn(const void *obj, const int flags)
{
const struct phone_profile *profile = obj;
-
+
return ast_str_case_hash(profile->name);
}
@@ -312,7 +312,7 @@
{
int len = 0;
FILE *f;
-
+
if (!(f = fopen(filename, "r"))) {
*ret = NULL;
return -1;
@@ -358,7 +358,7 @@
snprintf(buffer, sizeof(buffer), "%d", tzoffset);
var = ast_var_assign("TZOFFSET", buffer);
if (var)
- AST_LIST_INSERT_TAIL(headp, var, entries);
+ AST_LIST_INSERT_TAIL(headp, var, entries);
if (!dstenable)
return;
@@ -366,7 +366,7 @@
if ((var = ast_var_assign("DST_ENABLE", "1")))
AST_LIST_INSERT_TAIL(headp, var, entries);
- when.tv_sec = dststart;
+ when.tv_sec = dststart;
ast_localtime(&when, &tm_info, zone);
snprintf(buffer, sizeof(buffer), "%d", tm_info.tm_mon+1);
@@ -443,7 +443,7 @@
"Content-Length: %d\r\n"
"Content-Type: %s\r\n\r\n",
ast_get_version(), buf, len, route->file->mime_type);
-
+
while ((len = read(fd, buf, sizeof(buf))) > 0) {
if (fwrite(buf, 1, len, ser->f) != len) {
ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
@@ -473,7 +473,7 @@
/* XXX This is a hack -- maybe sum length of all variables in route->user->headp and add that? */
bufsize = len + VAR_BUF_SIZE;
-
+
/* malloc() instead of alloca() here, just in case the file is bigger than
* we have enough stack space for. */
if (!(tmp = ast_calloc(1, bufsize))) {
@@ -506,7 +506,7 @@
}
pbx_substitute_variables_varshead(AST_LIST_FIRST(&route->user->extensions)->headp, file, tmp, bufsize);
-
+
if (file) {
ast_free(file);
}
@@ -548,7 +548,7 @@
static void build_route(struct phoneprov_file *pp_file, struct user *user, char *uri)
{
struct http_route *route;
-
+
if (!(route = ao2_alloc(sizeof(*route), route_destructor))) {
return;
}
@@ -585,7 +585,7 @@
profile = unref_profile(profile);
return;
}
-
+
if (!(profile->headp = ast_calloc(1, sizeof(*profile->headp)))) {
profile = unref_profile(profile);
return;
@@ -606,7 +606,7 @@
AST_APP_ARG(varname);
AST_APP_ARG(varval);
);
-
+
AST_NONSTANDARD_APP_ARGS(args, value_copy, '=');
do {
if (ast_strlen_zero(args.varname) || ast_strlen_zero(args.varval))
@@ -623,7 +623,7 @@
} else {
struct phoneprov_file *pp_file;
char *file_extension;
- char *value_copy = ast_strdupa(v->value);
+ char *value_copy = ast_strdupa(v->value);
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(filename);
@@ -708,15 +708,15 @@
if (!(exten = ast_calloc(1, sizeof(*exten)))) {
return NULL;
}
-
+
if (ast_string_field_init(exten, 32)) {
ast_free(exten);
exten = NULL;
return NULL;
}
-
+
ast_string_field_set(exten, name, name);
-
+
if (!(exten->headp = ast_calloc(1, sizeof(*exten->headp)))) {
ast_free(exten);
exten = NULL;
@@ -784,7 +784,7 @@
static int users_hash_fn(const void *obj, const int flags)
{
const struct user *user = obj;
-
+
return ast_str_case_hash(user->macaddress);
}
@@ -808,7 +808,7 @@
if (user->profile) {
user->profile = unref_profile(user->profile);
}
-
+
ast_string_field_free_memory(user);
}
@@ -834,7 +834,7 @@
profile = unref_profile(profile);
return NULL;
}
-
+
if (ast_string_field_init(user, 32)) {
profile = unref_profile(profile);
user = unref_user(user);
@@ -957,7 +957,7 @@
else if (!strcasecmp(v->name, "default_profile"))
ast_copy_string(global_default_profile, v->value, sizeof(global_default_profile));
}
- } else
+ } else
build_profile(cat, ast_variable_browse(phoneprov_cfg, cat));
}
@@ -973,11 +973,11 @@
if (!strcasecmp(cat, "general")) {
continue;
}
-
+
if (!strcasecmp(cat, "authentication"))
continue;
- if (!((tmp = ast_variable_retrieve(cfg, cat, "autoprov")) && ast_true(tmp)))
+ if (!((tmp = ast_variable_retrieve(cfg, cat, "autoprov")) && ast_true(tmp)))
continue;
if (!(mac = ast_variable_retrieve(cfg, cat, "macaddress"))) {
@@ -1051,7 +1051,7 @@
{
struct ao2_iterator i;
struct http_route *route;
-
+
i = ao2_iterator_init(http_routes, 0);
while ((route = ao2_iterator_next(&i))) {
ao2_unlink(http_routes, route);
@@ -1122,11 +1122,11 @@
char path[PATH_MAX];
char *file;
int filelen;
- AST_DECLARE_APP_ARGS(args,
+ AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(mac);
AST_APP_ARG(template);
);
-
+
AST_STANDARD_APP_ARGS(args, data);
if (ast_strlen_zero(args.mac) || ast_strlen_zero(args.template)) {
@@ -1182,7 +1182,7 @@
#define FORMAT "%-40.40s %-30.30s\n"
struct ao2_iterator i;
struct http_route *route;
-
+
switch(cmd) {
case CLI_INIT:
e->command = "phoneprov show routes";
@@ -1242,13 +1242,13 @@
AST_LIST_HEAD_INIT_NOLOCK(&global_variables);
ast_mutex_init(&globals_lock);
-
+
ast_custom_function_register(&pp_each_user_function);
ast_custom_function_register(&pp_each_extension_function);
ast_cli_register_multiple(pp_cli, ARRAY_LEN(pp_cli));
set_config();
- ast_http_uri_link(&phoneprovuri);
+ ast_http_uri_link(&phoneprovuri);
return 0;
}
@@ -1280,7 +1280,7 @@
return 0;
}
-static int reload(void)
+static int reload(void)
{
struct ast_var_t *var;
More information about the asterisk-commits
mailing list