The Layout is a simple place holder for the distribution layout. More...
#include <I_Layout.h>
Public Member Functions | |
Layout (const char *prefix=0) | |
~Layout () | |
char * | relative (const char *file) |
Return file path relative to Layout->prefix Memory is allocated, so use ats_free() when no longer needed. | |
void | relative (char *buf, size_t bufsz, const char *file) |
Return file path relative to Layout->prefix Store the path to buf. | |
Static Public Member Functions | |
static char * | relative_to (const char *dir, const char *file) |
Return file path relative to dir Memory is allocated, so use ats_free() when no longer needed Example usage: Layout::relative_to(default_layout()->sysconfdir, "foo.bar");. | |
static void | relative_to (char *buf, size_t bufsz, const char *dir, const char *file) |
Return file path relative to dir Store the path to buf. | |
static void | create (const char *prefix=0) |
Creates a Layout Object with the given prefix. | |
static Layout * | get () |
Returns the Layout object created by create_default_layout(). | |
Data Fields | |
char * | prefix |
char * | exec_prefix |
char * | bindir |
char * | sbindir |
char * | sysconfdir |
char * | datadir |
char * | includedir |
char * | libdir |
char * | libexecdir |
char * | localstatedir |
char * | sharedstatedir |
char * | runtimedir |
char * | logdir |
char * | mandir |
char * | infodir |
char * | cachedir |
The Layout is a simple place holder for the distribution layout.
Definition at line 38 of file I_Layout.h.
Layout::Layout | ( | const char * | prefix = 0 |
) |
Definition at line 137 of file Layout.cc.
References ats_strdup, bindir, cachedir, datadir, exec_prefix, includedir, infodir, ink_error(), ink_strlcpy(), layout_relative(), libdir, libexecdir, localstatedir, logdir, mandir, PATH_NAME_MAX, prefix, runtimedir, sbindir, sysconfdir, TS_BUILD_BINDIR, TS_BUILD_CACHEDIR, TS_BUILD_DATADIR, TS_BUILD_EXEC_PREFIX, TS_BUILD_INCLUDEDIR, TS_BUILD_INFODIR, TS_BUILD_LIBDIR, TS_BUILD_LIBEXECDIR, TS_BUILD_LOCALSTATEDIR, TS_BUILD_LOGDIR, TS_BUILD_MANDIR, TS_BUILD_PREFIX, TS_BUILD_RUNTIMEDIR, TS_BUILD_SBINDIR, and TS_BUILD_SYSCONFDIR.
Referenced by create().
Layout::~Layout | ( | ) |
Definition at line 181 of file Layout.cc.
References ats_free(), bindir, cachedir, datadir, exec_prefix, includedir, infodir, libdir, libexecdir, localstatedir, logdir, mandir, prefix, runtimedir, sbindir, and sysconfdir.
void Layout::create | ( | const char * | prefix = 0 |
) | [static] |
Layout * Layout::get | ( | void | ) | [static] |
Returns the Layout object created by create_default_layout().
Definition at line 30 of file Layout.cc.
References ink_assert.
Referenced by UpdateConfigManager::BuildUpdateList(), chdir_root(), check_config_directories(), check_lockfile(), ICPConfiguration::icp_config_change_callback(), SSLConfigParams::initialize(), loadSocksConfiguration(), main(), open_main_log(), parse_include_directive(), plugin_init(), Store::read_config(), read_MachineList(), RecConfigReadBinDir(), RecConfigReadConfigPath(), RecConfigReadLogDir(), RecConfigReadPrefixPath(), RecConfigReadRuntimeDir(), RecConfigReadSnapshotDir(), RecCoreInit(), HttpBodyFactory::reconfigure(), set_paths_helper(), SSLPrivateKeyHandler(), HostDBCache::start(), TSConfigDirGet(), TSInstallDirGet(), and UrlRewrite::UrlRewrite().
void Layout::relative | ( | char * | buf, | |
size_t | bufsz, | |||
const char * | file | |||
) |
Return file path relative to Layout->prefix Store the path to buf.
The buf should be large eough to store PATH_NAME_MAX characters
Definition at line 75 of file Layout.cc.
References ink_error(), ink_filepath_merge(), INK_FILEPATH_TRUENAME, ink_strlcpy(), PATH_NAME_MAX, and prefix.
char * Layout::relative | ( | const char * | file | ) |
Return file path relative to Layout->prefix Memory is allocated, so use ats_free() when no longer needed.
Definition at line 69 of file Layout.cc.
References layout_relative(), and prefix.
Referenced by Store::read_config(), RecConfigReadBinDir(), RecConfigReadLogDir(), RecConfigReadRuntimeDir(), and HttpBodyFactory::reconfigure().
char * Layout::relative_to | ( | const char * | dir, | |
const char * | file | |||
) | [static] |
Return file path relative to dir Memory is allocated, so use ats_free() when no longer needed Example usage: Layout::relative_to(default_layout()->sysconfdir, "foo.bar");.
Definition at line 104 of file Layout.cc.
References layout_relative().
Referenced by UpdateConfigManager::BuildUpdateList(), check_lockfile(), cmd_clear(), initialize_all_global_stats(), loadSocksConfiguration(), parse_include_directive(), plugin_init(), MultiCacheBase::read_config(), RecConfigReadConfigPath(), RecConfigReadPersistentStatsPath(), RecConfigReadPrefixPath(), RecConfigReadSnapshotDir(), RecCoreInit(), set_paths_helper(), ssl_store_ssl_context(), SSLInitServerContext(), HostDBCache::start(), UrlRewrite::UrlRewrite(), and MultiCacheBase::write_config().
void Layout::relative_to | ( | char * | buf, | |
size_t | bufsz, | |||
const char * | dir, | |||
const char * | file | |||
) | [static] |
Return file path relative to dir Store the path to buf.
The buf should be large eough to store PATH_NAME_MAX characters Example usage: Layout::relative_to(default_layout()->sysconfdir, "foo.bar");
Definition at line 110 of file Layout.cc.
References ink_error(), ink_filepath_merge(), INK_FILEPATH_TRUENAME, ink_strlcpy(), and PATH_NAME_MAX.
char* Layout::bindir |
Definition at line 42 of file I_Layout.h.
char* Layout::cachedir |
Definition at line 55 of file I_Layout.h.
char* Layout::datadir |
Definition at line 45 of file I_Layout.h.
char* Layout::exec_prefix |
Definition at line 41 of file I_Layout.h.
char* Layout::includedir |
Definition at line 46 of file I_Layout.h.
char* Layout::infodir |
Definition at line 54 of file I_Layout.h.
char* Layout::libdir |
Definition at line 47 of file I_Layout.h.
char* Layout::libexecdir |
Definition at line 48 of file I_Layout.h.
char* Layout::localstatedir |
Definition at line 49 of file I_Layout.h.
char* Layout::logdir |
Definition at line 52 of file I_Layout.h.
char* Layout::mandir |
Definition at line 53 of file I_Layout.h.
char* Layout::prefix |
Definition at line 40 of file I_Layout.h.
Referenced by chdir_root(), Layout(), relative(), TSInstallDirGet(), and ~Layout().
char* Layout::runtimedir |
Definition at line 51 of file I_Layout.h.
char* Layout::sbindir |
Definition at line 43 of file I_Layout.h.
char* Layout::sharedstatedir |
Definition at line 50 of file I_Layout.h.
char* Layout::sysconfdir |
Definition at line 44 of file I_Layout.h.
Referenced by Layout(), TSConfigDirGet(), and ~Layout().