[asterisk-commits] branch bweschke/func_realtime_bug_5695 r12836 - /team/bweschke/func_realtime_...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 13 15:27:39 MST 2006


Author: bweschke
Date: Mon Mar 13 16:27:38 2006
New Revision: 12836

URL: http://svn.digium.com/view/asterisk?rev=12836&view=rev
Log:
 Merging in rizzo's patches to this function


Modified:
    team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c

Modified: team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c?rev=12836&r1=12835&r2=12836&view=diff
==============================================================================
--- team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c (original)
+++ team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c Mon Mar 13 16:27:38 2006
@@ -42,7 +42,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 
-static char *function_realtime_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
+static int function_realtime_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
 {
 
 	struct ast_variable *var=NULL,*head=NULL;
@@ -58,7 +58,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|metamatch[|value[|delim1[|delim2]]]) - missing argument!\n");
-		return NULL;
+		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
 
@@ -83,13 +83,13 @@
 		}	
 	}
 	else
-		return NULL;
+		return -1;
 	ast_copy_string(buf, results, len);
 	
-	return buf;
+	return 0;
 }
 
-static void function_realtime_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
+static int function_realtime_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
 {
 	int res = 0;
 	AST_DECLARE_APP_ARGS(args,
@@ -101,7 +101,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|metamatch|value|newcol) - missing argument!\n");
-		return;
+		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
 
@@ -111,12 +111,9 @@
 		ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n");
 	}
 
-	return;
+	return 0;
 }
 
-#ifndef BUILTIN_FUNC
-static
-#endif
 struct ast_custom_function realtime_function = {
 	.name = "REALTIME",
 	.synopsis = "RealTime Read/Write Functions",



More information about the asterisk-commits mailing list