[Asterisk-cvs] asterisk Makefile,1.140,1.141 app.c,1.51,1.52

markster at lists.digium.com markster at lists.digium.com
Fri Mar 11 23:41:21 CST 2005


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

Modified Files:
	Makefile app.c 
Log Message:
Create experimental new options API, various cleanups


Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- Makefile	11 Mar 2005 08:49:00 -0000	1.140
+++ Makefile	12 Mar 2005 05:37:32 -0000	1.141
@@ -430,6 +430,7 @@
 	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
 	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
 	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
+	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
 	install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
 	install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
 	install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/	

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- app.c	5 Mar 2005 21:06:25 -0000	1.51
+++ app.c	12 Mar 2005 05:37:32 -0000	1.52
@@ -1455,3 +1455,38 @@
 	return output;
 }
 
+int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, char **args, char *optstr)
+{
+	char *s;
+	int curarg;
+	int argloc;
+	char *arg;
+	int res = 0;
+	flags->flags = 0;
+	if (!optstr)
+		return 0;
+	s = optstr;
+	while(*s) {
+		curarg = *s & 0x7f;
+		flags->flags |= options[curarg].flag;
+		argloc = options[curarg].argoption;
+		s++;
+		if (*s == '(') {
+			/* Has argument */
+			s++;
+			arg = s;
+			while(*s && (*s != ')')) s++;
+			if (*s) {
+				if (argloc)
+					args[argloc - 1] = arg;
+				*s = '\0';
+				s++;
+			} else {
+				ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c'\n", curarg);
+				res = -1;
+			}
+		}
+	}
+	return res;
+}
+




More information about the svn-commits mailing list