[Asterisk-cvs] asterisk pbx.c,1.118,1.119

citats at lists.digium.com citats at lists.digium.com
Sun May 9 03:09:27 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv28188

Modified Files:
	pbx.c 
Log Message:
Code formatting fixes in pbx.c (still more todo)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- pbx.c	4 May 2004 06:34:34 -0000	1.118
+++ pbx.c	9 May 2004 07:19:00 -0000	1.119
@@ -777,10 +777,11 @@
 	struct ast_var_t *variables;
 	char *name, *num; /* for callerid name + num variables */
 	struct varshead *headp=NULL;
-    if (c) 
+
+	if (c) 
 		headp=&c->varshead;
-    *ret=NULL;
-        /* Now we have the variable name on cp3 */
+	*ret=NULL;
+	/* Now we have the variable name on cp3 */
 	if (!strncasecmp(var,"LEN(",4)) {
 		int len=strlen(var);
 		int len_len=4;
@@ -888,45 +889,45 @@
 		strncpy(workspace, c->name, workspacelen - 1);
 		*ret = workspace;
 	} else if (c && !strcmp(var, "EPOCH")) {
-	  snprintf(workspace, workspacelen -1, "%u",(int)time(NULL));
-	  *ret = workspace;
+		snprintf(workspace, workspacelen -1, "%u",(int)time(NULL));
+		*ret = workspace;
 	} else if (c && !strcmp(var, "DATETIME")) {
-	  thistime=time(NULL);
-	  localtime_r(&thistime, &brokentime);
-	  snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d",
-		   brokentime.tm_mday,
-		   brokentime.tm_mon+1,
-		   brokentime.tm_year+1900,
-		   brokentime.tm_hour,
-		   brokentime.tm_min,
-		   brokentime.tm_sec
-		   );
-	  *ret = workspace;
+		thistime=time(NULL);
+		localtime_r(&thistime, &brokentime);
+		snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d",
+			brokentime.tm_mday,
+			brokentime.tm_mon+1,
+			brokentime.tm_year+1900,
+			brokentime.tm_hour,
+			brokentime.tm_min,
+			brokentime.tm_sec
+		);
+		*ret = workspace;
 	} else if (c && !strcmp(var, "TIMESTAMP")) {
-	  thistime=time(NULL);
-	  localtime_r(&thistime, &brokentime);
+		thistime=time(NULL);
+		localtime_r(&thistime, &brokentime);
 		/* 20031130-150612 */
-	  snprintf(workspace, workspacelen -1, "%04d%02d%02d-%02d%02d%02d",
-		   brokentime.tm_year+1900,
-		   brokentime.tm_mon+1,
-		   brokentime.tm_mday,
-		   brokentime.tm_hour,
-		   brokentime.tm_min,
-		   brokentime.tm_sec
-		   );
-	  *ret = workspace;
+		snprintf(workspace, workspacelen -1, "%04d%02d%02d-%02d%02d%02d",
+			brokentime.tm_year+1900,
+			brokentime.tm_mon+1,
+			brokentime.tm_mday,
+			brokentime.tm_hour,
+			brokentime.tm_min,
+			brokentime.tm_sec
+		);
+		*ret = workspace;
 	} else if (c && !strcmp(var, "UNIQUEID")) {
-	  snprintf(workspace, workspacelen -1, "%s", c->uniqueid);
-	  *ret = workspace;
-        } else if (c && !strcmp(var, "HANGUPCAUSE")) {
-          snprintf(workspace, workspacelen -1, "%i", c->hangupcause);
-          *ret = workspace;
-        } else if (c && !strcmp(var, "ACCOUNTCODE")) {
-          strncpy(workspace, c->accountcode, workspacelen - 1);
-          *ret = workspace;
-        } else if (c && !strcmp(var, "LANGUAGE")) {
-          strncpy(workspace, c->language, workspacelen - 1);
-          *ret = workspace;
+		snprintf(workspace, workspacelen -1, "%s", c->uniqueid);
+		*ret = workspace;
+	} else if (c && !strcmp(var, "HANGUPCAUSE")) {
+		snprintf(workspace, workspacelen -1, "%i", c->hangupcause);
+		*ret = workspace;
+	} else if (c && !strcmp(var, "ACCOUNTCODE")) {
+		strncpy(workspace, c->accountcode, workspacelen - 1);
+		*ret = workspace;
+	} else if (c && !strcmp(var, "LANGUAGE")) {
+		strncpy(workspace, c->language, workspacelen - 1);
+		*ret = workspace;
 	} else {
 		if (c) {
 			AST_LIST_TRAVERSE(headp,variables,entries) {
@@ -1342,13 +1343,13 @@
 
 int ast_extension_state(struct ast_channel *c, char *context, char *exten)
 {
-    struct ast_exten *e;
+	struct ast_exten *e;
 
-    e = ast_hint_extension(c, context, exten);    
-    if (!e) 
-	return -1;
+	e = ast_hint_extension(c, context, exten);    
+	if (!e) 
+		return -1;
 
-    return ast_extension_state2(e);    
+	return ast_extension_state2(e);    
 }
 
 int ast_device_state_changed(const char *fmt, ...) 
@@ -4418,12 +4419,13 @@
 	return 0;
 }
 
-char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name) {
+char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name) 
+{
 	struct ast_var_t *variables;
 	struct varshead *headp;
 
-    if (chan)
-        headp=&chan->varshead;
+	if (chan)
+		headp=&chan->varshead;
 	else
 		headp=&globals;
 
@@ -4444,11 +4446,12 @@
 	return NULL;
 }
 
-void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value) {
+void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value) 
+{
 	struct ast_var_t *newvariable;
-        struct varshead *headp;
-    if (chan)
-        headp=&chan->varshead;
+	struct varshead *headp;
+	if (chan)
+		headp=&chan->varshead;
 	else
 		headp=&globals;
                 
@@ -4526,7 +4529,8 @@
 	}
 }
 
-static int pbx_checkcondition(char *condition) {
+static int pbx_checkcondition(char *condition) 
+{
 	char *s;
 	int ret;
 	
@@ -4599,8 +4603,6 @@
                    return -1;
 		}
 	}
-
-
 	return res = ast_say_number(chan, atoi((char *) tmp), "", chan->language, options);
 }
 




More information about the svn-commits mailing list