[asterisk-commits] anthonyl: branch anthonyl/indication-sf r46709 - in /team/anthonyl/indication...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 31 13:10:07 MST 2006


Author: anthonyl
Date: Tue Oct 31 14:10:07 2006
New Revision: 46709

URL: http://svn.digium.com/view/asterisk?rev=46709&view=rev
Log:
updating with some string field support.

M    include/asterisk/indications.h
M    main/indications.c
M    res/res_indications.c

Modified:
    team/anthonyl/indication-sf/include/asterisk/indications.h
    team/anthonyl/indication-sf/main/indications.c
    team/anthonyl/indication-sf/res/res_indications.c

Modified: team/anthonyl/indication-sf/include/asterisk/indications.h
URL: http://svn.digium.com/view/asterisk/team/anthonyl/indication-sf/include/asterisk/indications.h?rev=46709&r1=46708&r2=46709&view=diff
==============================================================================
--- team/anthonyl/indication-sf/include/asterisk/indications.h (original)
+++ team/anthonyl/indication-sf/include/asterisk/indications.h Tue Oct 31 14:10:07 2006
@@ -33,11 +33,16 @@
 #define _ASTERISK_INDICATIONS_H
 
 #include "asterisk/lock.h"
+#include "asterisk/stringfields.h"
 
 struct tone_zone_sound {
 	struct tone_zone_sound *next;		/* next element */
-	const char *name;			/* Identifing name */
-	const char *data;			/* Actual zone description */
+
+	AST_DECLARE_STRING_FIELDS(
+		AST_STRING_FIELD(name);
+		AST_STRING_FIELD(data);
+	);
+      
 	/* Description is a series of tones of the format:
 	   [!]freq1[+freq2][/duration] separated by commas.  There
 	   are no spaces.  The sequence is repeated back to the 

Modified: team/anthonyl/indication-sf/main/indications.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/indication-sf/main/indications.c?rev=46709&r1=46708&r2=46709&view=diff
==============================================================================
--- team/anthonyl/indication-sf/main/indications.c (original)
+++ team/anthonyl/indication-sf/main/indications.c Tue Oct 31 14:10:07 2006
@@ -550,10 +550,10 @@
 		}
 		ts->next = NULL;
 	}
-	if (!(ts->name = ast_strdup(indication)) || !(ts->data = ast_strdup(tonelist))) {
-		ast_mutex_unlock(&tzlock);
-		return -2;
-	}
+
+	ast_string_field_set(ts,data,indication);
+	ast_string_field_set(ts,data,tonelist);
+
 	if (ps)
 		ps->next = ts;
 	else

Modified: team/anthonyl/indication-sf/res/res_indications.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/indication-sf/res/res_indications.c?rev=46709&r1=46708&r2=46709&view=diff
==============================================================================
--- team/anthonyl/indication-sf/res/res_indications.c (original)
+++ team/anthonyl/indication-sf/res/res_indications.c Tue Oct 31 14:10:07 2006
@@ -314,8 +314,11 @@
 					return -1;
 				}
 				ts->next = NULL;
-				ts->name = strdup(v->name);
-				ts->data = strdup(v->value);
+
+				ast_string_field_set(ts,name,v->name);
+				ast_string_field_set(ts,data,v->value);
+				
+				
 				if (ps)
 					ps->next = ts;
 				else



More information about the asterisk-commits mailing list