[Asterisk-cvs] asterisk/include/asterisk config.h, 1.8, 1.9 config_pvt.h, 1.1, 1.2 res_odbc.h, 1.1, 1.2 utils.h, 1.8, 1.9

markster at lists.digium.com markster at lists.digium.com
Tue Oct 5 02:44:38 CDT 2004


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

Modified Files:
	config.h config_pvt.h res_odbc.h utils.h 
Log Message:
Major changes to res_config to support centralized config, eliminate configuration of res_config_odbc, update config examples, integrate with iax2, remove mysql friends from iax2, put on flame retardant vest...


Index: config.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/config.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- config.h	2 Mar 2004 07:57:06 -0000	1.8
+++ config.h	5 Oct 2004 06:46:11 -0000	1.9
@@ -34,6 +34,7 @@
 	struct ast_comment *precomments;
 	struct ast_comment *sameline;
 	struct ast_variable *next;
+	char stuff[0];
 };
 
 //! Load a config file
@@ -103,12 +104,37 @@
  * Browse config structure and check for category duplicity Return non-zero if found */
 int ast_category_exist(struct ast_config *config, char *category_name);
 
-/* These are only in the config engine at this point */
-struct ast_variable *ast_variable_append_modify(struct ast_config *cfg, char *category, char *variable, char *newvalue, int newcat, int newvar, int move);
+//! Retrieve realtime configuration
+/*!
+ * \param family which family/config to lookup
+ * \param keyfield which field to use as the key
+ * \param lookup which value to look for in the key field to match the entry.
+ * This will use builtin configuration backends to look up a particular 
+ * entity in realtime and return a variable list of its parameters.  Note
+ * that unlike the variables in ast_config, the resulting list of variables
+ * MUST be fred with ast_free_runtime() as there is no container.
+ */
+struct ast_variable *ast_load_realtime(const char *family, const char *keyfield, const char *lookup);
 
-int ast_category_delete(struct ast_config *cfg, char *category);
-int ast_variable_delete(struct ast_config *cfg, char *category, char *variable, char *value);
-int ast_save(char *filename, struct ast_config *cfg, char *generator);
+//! Update realtime configuration
+/*!
+ * \param family which family/config to be updated
+ * \param keyfield which field to use as the key
+ * \param lookup which value to look for in the key field to match the entry.
+ * \param variable which variable should be updated in the config, NULL to end list
+ * \param value the value to be assigned to that variable in the given entity.
+ * This function is used to update a parameter in realtime configuration space.
+ *
+ */
+int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...);
+
+//! Free realtime configuration
+/*!
+ * \param var the linked list of variables to free
+ * This command free's a list of variables and should ONLY be used
+ * in conjunction with ast_load_realtime and not with the regular ast_load.
+ */
+void ast_destroy_realtime(struct ast_variable *var);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Index: config_pvt.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/config_pvt.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- config_pvt.h	11 Jun 2004 00:12:35 -0000	1.1
+++ config_pvt.h	5 Oct 2004 06:46:11 -0000	1.2
@@ -4,6 +4,7 @@
 extern "C" {
 #endif
 
+#include <stdarg.h>
 #define CONFIG_KEYWORD_STRLEN 128
 #define CONFIG_KEYWORD_ARRAYLEN 512
 #include <asterisk/config.h>
@@ -14,10 +15,6 @@
 	char name[80];
 	struct ast_variable *root;
 	struct ast_category *next;
-#ifdef PRESERVE_COMMENTS
-	struct ast_comment *precomments;
-	struct ast_comment *sameline;
-#endif	
 };
 
 struct ast_config {
@@ -25,43 +22,25 @@
 	   for now */
 	struct ast_category *root;
 	struct ast_category *prev;
-#ifdef PRESERVE_COMMENTS
-	struct ast_comment *trailingcomments;
-#endif	
 };
 
-#ifdef PRESERVE_COMMENTS
-struct ast_comment_struct
-{
-	struct ast_comment *root;
-	struct ast_comment *prev;
-};
-#endif
 
 struct ast_category;
 
 struct ast_config_reg {
 	char name[CONFIG_KEYWORD_STRLEN];
-	struct ast_config *(*func)(char *, struct ast_config *,struct ast_category **,struct ast_variable **,int
-#ifdef PRESERVE_COMMENTS
-,struct ast_comment_struct *
-#endif
-);
-	char keywords[CONFIG_KEYWORD_STRLEN][CONFIG_KEYWORD_ARRAYLEN];
-	int keycount;
+	struct ast_config *(*static_func)(const char *database, const char *table, const char *, struct ast_config *,struct ast_category **,struct ast_variable **,int);
+	struct ast_variable *(*realtime_func)(const char *database, const char *table,  const char *keyfield, const char *entity);
+	int (*update_func)(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
 	struct ast_config_reg *next;
 };
 
 
-
 int ast_config_register(struct ast_config_reg *new);
 int ast_config_deregister(struct ast_config_reg *del);
 void ast_cust_config_on(void);
 void ast_cust_config_off(void);
 int ast_cust_config_active(void);
-struct ast_config_reg *get_config_registrations(void);
-struct ast_config_reg *get_ast_cust_config(char *name);
-struct ast_config_reg *get_ast_cust_config_keyword(char *name);
 void ast_config_destroy_all(void);
 
 

Index: res_odbc.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/res_odbc.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- res_odbc.h	11 Jun 2004 00:12:35 -0000	1.1
+++ res_odbc.h	5 Oct 2004 06:46:11 -0000	1.2
@@ -45,7 +45,7 @@
 odbc_status odbc_obj_disconnect(odbc_obj *obj);
 void destroy_obdc_obj(odbc_obj **obj);
 int register_odbc_obj(char *name,odbc_obj *obj);
-odbc_obj *fetch_odbc_obj(char *name);
+odbc_obj *fetch_odbc_obj(const char *name);
 int odbc_dump_fd(int fd,odbc_obj *obj);
 
 #endif

Index: utils.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- utils.h	27 Aug 2004 04:21:09 -0000	1.8
+++ utils.h	5 Oct 2004 06:46:11 -0000	1.9
@@ -26,6 +26,8 @@
 	char buf[1024];
 };
 
+
+extern char *ast_strip(char *buf);
 extern struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp);
 extern int ast_base64encode(char *dst, unsigned char *src, int srclen, int max);
 extern int ast_base64decode(unsigned char *dst, char *src, int max);




More information about the svn-commits mailing list