Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added helper function to construct logdir relative file paths #330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libs/apr-toolkit/include/apt_dir_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ APT_DECLARE(char*) apt_datadir_filepath_get(const apt_dir_layout_t *dir_layout,
*/
APT_DECLARE(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 log dir.
* @param dir_layout the directory layout
* @param file_name the file name
* @param pool the memory pool to use
*/
APT_DECLARE(char*) apt_logdir_filepath_get(const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool);

APT_END_EXTERN_C

Expand Down
5 changes: 5 additions & 0 deletions libs/apr-toolkit/src/apt_dir_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,8 @@ APT_DECLARE(char*) apt_vardir_filepath_get(const apt_dir_layout_t *dir_layout, c
{
return apt_dir_layout_path_compose(dir_layout,APT_LAYOUT_VAR_DIR,file_name,pool);
}

APT_DECLARE(char*) apt_logdir_filepath_get(const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool)
{
return apt_dir_layout_path_compose(dir_layout,APT_LAYOUT_LOG_DIR,file_name,pool);
}