Asterisk - The Open Source Telephony Project GIT-master-67613d1
chanvars.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 1999 - 2005, Digium, Inc.
5 *
6 * Mark Spencer <markster@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*! \file
20 * \brief Channel Variables
21 */
22
23#ifndef _ASTERISK_CHANVARS_H
24#define _ASTERISK_CHANVARS_H
25
27
28struct ast_var_t {
30 char *value;
31 char name[0];
32};
33
35
36struct varshead *ast_var_list_create(void);
37void ast_var_list_destroy(struct varshead *head);
38
39struct ast_var_t *_ast_var_assign(const char *name, const char *value, const char *file, int lineno, const char *function);
40#define ast_var_assign(name, value) _ast_var_assign(name, value, __FILE__, __LINE__, __PRETTY_FUNCTION__)
41
42void ast_var_delete(struct ast_var_t *var);
43const char *ast_var_name(const struct ast_var_t *var);
44const char *ast_var_full_name(const struct ast_var_t *var);
45const char *ast_var_value(const struct ast_var_t *var);
46char *ast_var_find(const struct varshead *head, const char *name);
47struct varshead *ast_var_list_clone(struct varshead *head);
48
49#define AST_VAR_LIST_TRAVERSE(head, var) AST_LIST_TRAVERSE(head, var, entries)
50
51static inline void AST_VAR_LIST_INSERT_TAIL(struct varshead *head, struct ast_var_t *var) {
52 if (var) {
53 AST_LIST_INSERT_TAIL(head, var, entries);
54 }
55}
56
57static inline void AST_VAR_LIST_INSERT_HEAD(struct varshead *head, struct ast_var_t *var) {
58 if (var) {
59 AST_LIST_INSERT_HEAD(head, var, entries);
60 }
61}
62
63#endif /* _ASTERISK_CHANVARS_H */
#define var
Definition: ast_expr2f.c:605
void ast_var_list_destroy(struct varshead *head)
Definition: chanvars.c:109
char * ast_var_find(const struct varshead *head, const char *name)
Definition: chanvars.c:85
static void AST_VAR_LIST_INSERT_TAIL(struct varshead *head, struct ast_var_t *var)
Definition: chanvars.h:51
const char * ast_var_name(const struct ast_var_t *var)
Definition: chanvars.c:60
static void AST_VAR_LIST_INSERT_HEAD(struct varshead *head, struct ast_var_t *var)
Definition: chanvars.h:57
const char * ast_var_full_name(const struct ast_var_t *var)
Definition: chanvars.c:75
const char * ast_var_value(const struct ast_var_t *var)
Definition: chanvars.c:80
struct varshead * ast_var_list_clone(struct varshead *head)
Definition: chanvars.c:124
struct ast_var_t * _ast_var_assign(const char *name, const char *value, const char *file, int lineno, const char *function)
Definition: chanvars.c:36
void ast_var_delete(struct ast_var_t *var)
Definition: extconf.c:2471
struct varshead * ast_var_list_create(void)
Definition: chanvars.c:97
static const char name[]
Definition: format_mp3.c:68
A set of macros to manage forward-linked lists.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
Definition: linkedlists.h:225
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:731
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
Definition: linkedlists.h:410
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
Definition: linkedlists.h:711
char name[0]
Definition: chanvars.h:31
char * value
Definition: chanvars.h:30
struct ast_var_t::@211 entries
int value
Definition: syslog.c:37