chanvars.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Channel Variables
00021  */
00022 
00023 #ifndef _ASTERISK_CHANVARS_H
00024 #define _ASTERISK_CHANVARS_H
00025 
00026 #include "asterisk/linkedlists.h"
00027 
00028 struct ast_var_t {
00029    AST_LIST_ENTRY(ast_var_t) entries;
00030    char *value;
00031    char name[0];
00032 };
00033 
00034 AST_LIST_HEAD_NOLOCK(varshead, ast_var_t);
00035 
00036 struct varshead *ast_var_list_create(void);
00037 void ast_var_list_destroy(struct varshead *head);
00038 #ifdef MALLOC_DEBUG
00039 struct ast_var_t *_ast_var_assign(const char *name, const char *value, const char *file, int lineno, const char *function);
00040 #define ast_var_assign(a,b)   _ast_var_assign(a,b,__FILE__,__LINE__,__PRETTY_FUNCTION__)
00041 #else
00042 struct ast_var_t *ast_var_assign(const char *name, const char *value);
00043 #endif
00044 void ast_var_delete(struct ast_var_t *var);
00045 const char *ast_var_name(const struct ast_var_t *var);
00046 const char *ast_var_full_name(const struct ast_var_t *var);
00047 const char *ast_var_value(const struct ast_var_t *var);
00048 char *ast_var_find(const struct varshead *head, const char *name);
00049 struct varshead *ast_var_list_clone(struct varshead *head);
00050 
00051 #define AST_VAR_LIST_TRAVERSE(head, var) AST_LIST_TRAVERSE(head, var, entries)
00052 
00053 static inline void AST_VAR_LIST_INSERT_TAIL(struct varshead *head, struct ast_var_t *var) {
00054    if (var) {
00055       AST_LIST_INSERT_TAIL(head, var, entries);
00056    }
00057 }
00058 
00059 static inline void AST_VAR_LIST_INSERT_HEAD(struct varshead *head, struct ast_var_t *var) {
00060    if (var) {
00061       AST_LIST_INSERT_HEAD(head, var, entries);
00062    }
00063 }
00064 
00065 #endif /* _ASTERISK_CHANVARS_H */

Generated on Thu Apr 16 06:27:30 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6