Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include "asterisk/ast_expr.h"
#include "asterisk/inline_api.h"
#include "asterisk/lock.h"
Go to the source code of this file.
Data Structures | |
struct | varz |
Macros | |
#define | AST_API_MODULE 1 |
#define | AST_API_MODULE 1 |
#define | ASTMM_LIBC ASTMM_IGNORE |
Functions | |
int | __ast_bt_get_addresses (struct ast_bt *bt) |
struct ast_vector_string * | __ast_bt_get_symbols (void **addresses, size_t num_frames) |
int | ast_add_profile (const char *x, uint64_t scale) |
support for event profiling More... | |
struct ast_custom_function * | ast_custom_function_find (const char *name) |
void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments. More... | |
void | ast_mark_lock_acquired (void *) |
Mark the last lock as acquired. More... | |
void | ast_remove_lock_info (void *lock_addr, struct ast_bt *bt) |
remove lock info for the current thread More... | |
void | ast_restore_lock_info (void *lock_addr) |
void | ast_store_lock_info (enum ast_lock_type type, const char *filename, int line_num, const char *func, const char *lock_name, void *lock_addr, struct ast_bt *bt) |
Store lock info for the current thread. More... | |
void | ast_suspend_lock_info (void *lock_addr) |
int | check_eval (char *buffer, char *error_report) |
unsigned int | check_expr (char *buffer, char *error_report) |
char * | find_var (const char *varname) |
int | main (int argc, char **argv) |
void | parse_file (const char *fname) |
void | set_var (const char *varname, const char *varval) |
Variables | |
static int | global_expr_count =0 |
static int | global_expr_max_size =0 |
static int | global_expr_tot_size =0 |
static int | global_lineno = 1 |
static int | global_OK_count =0 |
struct varz * | global_varlist |
static int | global_warn_count =0 |
#define AST_API_MODULE 1 |
Definition at line 31 of file check_expr.c.
#define AST_API_MODULE 1 |
Definition at line 31 of file check_expr.c.
#define ASTMM_LIBC ASTMM_IGNORE |
Definition at line 23 of file check_expr.c.
int __ast_bt_get_addresses | ( | struct ast_bt * | bt | ) |
Definition at line 75 of file check_expr.c.
References __ast_bt_get_symbols().
Referenced by ast_remove_lock_info().
struct ast_vector_string* __ast_bt_get_symbols | ( | void ** | addresses, |
size_t | num_frames | ||
) |
Definition at line 81 of file check_expr.c.
References NULL.
Referenced by __ast_bt_get_addresses().
int ast_add_profile | ( | const char * | x, |
uint64_t | scale | ||
) |
support for event profiling
(note, this must be documented a lot more) ast_add_profile allocates a generic 'counter' with a given name, which can be shown with the command 'core show profile <name>'
The counter accumulates positive or negative values supplied by
support for event profiling
Definition at line 139 of file check_expr.c.
struct ast_custom_function* ast_custom_function_find | ( | const char * | name | ) |
void ast_log | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments.
level | Type of log event |
file | Will be provided by the AST_LOG_* macro |
line | Will be provided by the AST_LOG_* macro |
function | Will be provided by the AST_LOG_* macro |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
Definition at line 121 of file check_expr.c.
References check_eval(), check_expr(), find_var(), parse_file(), set_var(), varz::varname, and varz::varval.
void ast_mark_lock_acquired | ( | void * | foo | ) |
Mark the last lock as acquired.
Definition at line 94 of file check_expr.c.
Referenced by ast_restore_lock_info().
void ast_remove_lock_info | ( | void * | lock_addr, |
struct ast_bt * | bt | ||
) |
remove lock info for the current thread
this gets called by ast_mutex_unlock so that information on the lock can be removed from the current thread's lock info struct.
Definition at line 68 of file check_expr.c.
References __ast_bt_get_addresses().
Referenced by ast_store_lock_info().
void ast_restore_lock_info | ( | void * | lock_addr | ) |
void ast_store_lock_info | ( | enum ast_lock_type | type, |
const char * | filename, | ||
int | line_num, | ||
const char * | func, | ||
const char * | lock_name, | ||
void * | lock_addr, | ||
struct ast_bt * | bt | ||
) |
Store lock info for the current thread.
This function gets called in ast_mutex_lock() and ast_mutex_trylock() so that information about this lock can be stored in this thread's lock info struct. The lock is marked as pending as the thread is waiting on the lock. ast_mark_lock_acquired() will mark it as held by this thread.
Definition at line 61 of file check_expr.c.
References ast_remove_lock_info().
void ast_suspend_lock_info | ( | void * | lock_addr | ) |
Definition at line 87 of file check_expr.c.
int check_eval | ( | char * | buffer, |
char * | error_report | ||
) |
Definition at line 242 of file check_expr.c.
References ast_expr(), find_var(), global_lineno, NULL, parse_file(), result, and varz::varname.
Referenced by ast_log(), check_expr(), and parse_file().
unsigned int check_expr | ( | char * | buffer, |
char * | error_report | ||
) |
Definition at line 165 of file check_expr.c.
References ast_custom_function_find(), check_eval(), global_lineno, global_warn_count, and name.
Referenced by ast_log(), and parse_file().
char * find_var | ( | const char * | varname | ) |
Definition at line 141 of file check_expr.c.
References varz::next, set_var(), varz::varname, and varz::varval.
Referenced by ast_log(), and check_eval().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 406 of file check_expr.c.
References parse_file(), and set_var().
void parse_file | ( | const char * | fname | ) |
Definition at line 315 of file check_expr.c.
References check_eval(), check_expr(), global_expr_count, global_expr_max_size, global_expr_tot_size, global_lineno, global_OK_count, global_warn_count, and retval.
Referenced by ast_log(), check_eval(), and main().
void set_var | ( | const char * | varname, |
const char * | varval | ||
) |
Definition at line 154 of file check_expr.c.
References calloc, global_varlist, varz::next, varz::varname, and varz::varval.
Referenced by ast_log(), find_var(), and main().
|
static |
Definition at line 102 of file check_expr.c.
Referenced by parse_file().
|
static |
Definition at line 103 of file check_expr.c.
Referenced by parse_file().
|
static |
Definition at line 104 of file check_expr.c.
Referenced by parse_file().
|
static |
Definition at line 101 of file check_expr.c.
Referenced by check_eval(), check_expr(), and parse_file().
|
static |
Definition at line 106 of file check_expr.c.
Referenced by parse_file().
struct varz* global_varlist |
Definition at line 115 of file check_expr.c.
Referenced by set_var().
|
static |
Definition at line 105 of file check_expr.c.
Referenced by check_expr(), and parse_file().