OpenOCD
configuration.c File Reference
Include dependency graph for configuration.c:

Go to the source code of this file.

Functions

void add_config_command (const char *cfg)
 
void add_script_search_dir (const char *dir)
 
char * find_file (const char *file)
 
void free_config (void)
 
char * get_home_dir (const char *append_path)
 
FILE * open_file_from_path (const char *file, const char *mode)
 
int parse_config_file (struct command_context *cmd_ctx)
 

Variables

static char ** config_file_names
 
static size_t num_config_files
 
static size_t num_script_dirs
 
static char ** script_search_dirs
 

Function Documentation

◆ add_config_command()

void add_config_command ( const char *  cfg)

Definition at line 36 of file configuration.c.

References config_file_names, NULL, and num_config_files.

Referenced by parse_cmdline_args().

◆ add_script_search_dir()

void add_script_search_dir ( const char *  dir)

◆ find_file()

char* find_file ( const char *  file)

Definition at line 61 of file configuration.c.

References alloc_printf(), fp, LOG_DEBUG, mode, NULL, and script_search_dirs.

Referenced by COMMAND_HANDLER(), and open_file_from_path().

◆ free_config()

void free_config ( void  )

Definition at line 45 of file configuration.c.

References config_file_names, NULL, num_config_files, num_script_dirs, and script_search_dirs.

Referenced by openocd_main().

◆ get_home_dir()

char* get_home_dir ( const char *  append_path)

Definition at line 138 of file configuration.c.

References alloc_printf().

Referenced by telnet_load_history(), and telnet_save_history().

◆ open_file_from_path()

FILE* open_file_from_path ( const char *  file,
const char *  mode 
)

Definition at line 97 of file configuration.c.

References find_file(), fp, mode, and NULL.

Referenced by fileio_open_local().

◆ parse_config_file()

int parse_config_file ( struct command_context cmd_ctx)

Definition at line 112 of file configuration.c.

References command_run_line(), config_file_names, and ERROR_OK.

Referenced by openocd_thread().

Variable Documentation

◆ config_file_names

char** config_file_names
static

Definition at line 20 of file configuration.c.

Referenced by add_config_command(), free_config(), and parse_config_file().

◆ num_config_files

size_t num_config_files
static

Definition at line 19 of file configuration.c.

Referenced by add_config_command(), and free_config().

◆ num_script_dirs

size_t num_script_dirs
static

Definition at line 22 of file configuration.c.

Referenced by add_script_search_dir(), and free_config().

◆ script_search_dirs

char** script_search_dirs
static

Definition at line 23 of file configuration.c.

Referenced by add_script_search_dir(), find_file(), and free_config().