UniMRCP  1.7.0
Macros | Typedefs | Enumerations | Functions
apt_dir_layout.h File Reference

Directories Layout. More...

#include "apt.h"
Include dependency graph for apt_dir_layout.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct apt_dir_layout_t apt_dir_layout_t
 

Enumerations

enum  apt_dir_entry_id {
  APT_LAYOUT_CONF_DIR, APT_LAYOUT_PLUGIN_DIR, APT_LAYOUT_LOG_DIR, APT_LAYOUT_DATA_DIR,
  APT_LAYOUT_VAR_DIR, APT_LAYOUT_DIR_COUNT, APT_LAYOUT_EXT_DIR = APT_LAYOUT_DIR_COUNT
}
 

Functions

apt_dir_layout_tapt_default_dir_layout_create (const char *root_dir_path, apr_pool_t *pool)
 
apt_dir_layout_tapt_custom_dir_layout_create (const char *conf_dir_path, const char *plugin_dir_path, const char *log_dir_path, const char *data_dir_path, const char *var_dir_path, apr_pool_t *pool)
 
apt_dir_layout_tapt_dir_layout_create (apr_pool_t *pool)
 
apt_dir_layout_tapt_dir_layout_create_ext (apr_size_t count, apr_pool_t *pool)
 
apt_bool_t apt_dir_layout_load (apt_dir_layout_t *dir_layout, const char *config_file, apr_pool_t *pool)
 
apt_bool_t apt_dir_layout_load_ext (apt_dir_layout_t *dir_layout, const char *config_file, const char **labels, apr_size_t count, apr_pool_t *pool)
 
apt_bool_t apt_dir_layout_path_set (apt_dir_layout_t *dir_layout, apr_size_t dir_entry_id, const char *path, apr_pool_t *pool)
 
const char * apt_dir_layout_path_get (const apt_dir_layout_t *dir_layout, apr_size_t dir_entry_id)
 
char * apt_dir_layout_path_compose (const apt_dir_layout_t *dir_layout, apr_size_t dir_entry_id, const char *file_name, apr_pool_t *pool)
 
char * apt_confdir_filepath_get (const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool)
 
char * apt_datadir_filepath_get (const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool)
 
char * apt_vardir_filepath_get (const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool)
 

Detailed Description

Directories Layout.

Typedef Documentation

◆ apt_dir_layout_t

Directories layout declaration

Enumeration Type Documentation

◆ apt_dir_entry_id

Enumeration of directories the layout is composed of

Enumerator
APT_LAYOUT_CONF_DIR 

configuration directory

APT_LAYOUT_PLUGIN_DIR 

plugin directory

APT_LAYOUT_LOG_DIR 

log directory

APT_LAYOUT_DATA_DIR 

data directory

APT_LAYOUT_VAR_DIR 

var directory

APT_LAYOUT_DIR_COUNT 

number of directories in the default layout

Function Documentation

◆ apt_confdir_filepath_get()

char* apt_confdir_filepath_get ( const apt_dir_layout_t dir_layout,
const char *  file_name,
apr_pool_t *  pool 
)

Compose a file path relative to config dir.

Parameters
dir_layoutthe directory layout
file_namethe file name
poolthe memory pool to use

◆ apt_custom_dir_layout_create()

apt_dir_layout_t* apt_custom_dir_layout_create ( const char *  conf_dir_path,
const char *  plugin_dir_path,
const char *  log_dir_path,
const char *  data_dir_path,
const char *  var_dir_path,
apr_pool_t *  pool 
)

Create a custom directories layout based on the specified individual directories.

Parameters
conf_dir_paththe path to the config dir
plugin_dir_paththe path to the plugin dir
log_dir_paththe path to the log dir
data_dir_paththe path to the data dir
var_dir_paththe path to the var dir
poolthe memory pool to use

◆ apt_datadir_filepath_get()

char* apt_datadir_filepath_get ( const apt_dir_layout_t dir_layout,
const char *  file_name,
apr_pool_t *  pool 
)

Compose a file path relative to data dir.

Parameters
dir_layoutthe directory layout
file_namethe file name
poolthe memory pool to use

◆ apt_default_dir_layout_create()

apt_dir_layout_t* apt_default_dir_layout_create ( const char *  root_dir_path,
apr_pool_t *  pool 
)

Create the default directories layout based on the specified root directory.

Parameters
root_dir_paththe path to the root directory
poolthe memory pool to use

◆ apt_dir_layout_create()

apt_dir_layout_t* apt_dir_layout_create ( apr_pool_t *  pool)

Create a bare directories layout.

Parameters
poolthe memory pool to use

◆ apt_dir_layout_create_ext()

apt_dir_layout_t* apt_dir_layout_create_ext ( apr_size_t  count,
apr_pool_t *  pool 
)

Create an extended bare directories layout.

Parameters
countthe number of directories in the layout
poolthe memory pool to use

◆ apt_dir_layout_load()

apt_bool_t apt_dir_layout_load ( apt_dir_layout_t dir_layout,
const char *  config_file,
apr_pool_t *  pool 
)

Load directories layout from the specified configuration file.

Parameters
dir_layoutthe directory layout
config_filethe path to the configuration file
poolthe memory pool to use

◆ apt_dir_layout_load_ext()

apt_bool_t apt_dir_layout_load_ext ( apt_dir_layout_t dir_layout,
const char *  config_file,
const char **  labels,
apr_size_t  count,
apr_pool_t *  pool 
)

Load directories layout from the specified configuration file using the provided labels.

Parameters
dir_layoutthe directory layout
config_filethe path to the configuration file
labelsthe array of directory labels (configuration entries)
countthe number of labels (normally equals the number of directories in the layout)
poolthe memory pool to use

◆ apt_dir_layout_path_compose()

char* apt_dir_layout_path_compose ( const apt_dir_layout_t dir_layout,
apr_size_t  dir_entry_id,
const char *  file_name,
apr_pool_t *  pool 
)

Compose a file path relative to the specified directory in the layout.

Parameters
dir_layoutthe directory layout
dir_entry_idthe directory id (apt_dir_entry_id)
file_namethe file name to append to the directory path
poolthe memory pool to use

◆ apt_dir_layout_path_get()

const char* apt_dir_layout_path_get ( const apt_dir_layout_t dir_layout,
apr_size_t  dir_entry_id 
)

Get the path to the individual directory in the layout.

Parameters
dir_layoutthe directory layout
dir_entry_idthe directory id (apt_dir_entry_id)

◆ apt_dir_layout_path_set()

apt_bool_t apt_dir_layout_path_set ( apt_dir_layout_t dir_layout,
apr_size_t  dir_entry_id,
const char *  path,
apr_pool_t *  pool 
)

Set the path to the individual directory in the layout.

Parameters
dir_layoutthe directory layout
dir_entry_idthe directory id (apt_dir_entry_id)
paththe directory path
poolthe memory pool to use

◆ apt_vardir_filepath_get()

char* apt_vardir_filepath_get ( const apt_dir_layout_t dir_layout,
const char *  file_name,
apr_pool_t *  pool 
)

Compose a file path relative to var dir.

Parameters
dir_layoutthe directory layout
file_namethe file name
poolthe memory pool to use