Public Member Functions | Static Public Member Functions | Data Fields

Layout Struct Reference

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 Layoutget ()
 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

Detailed Description

The Layout is a simple place holder for the distribution layout.

Definition at line 38 of file I_Layout.h.


Constructor & Destructor Documentation

Layout::Layout ( const char *  prefix = 0  ) 
Layout::~Layout (  ) 

Member Function Documentation

void Layout::create ( const char *  prefix = 0  )  [static]

Creates a Layout Object with the given prefix.

If no prefix is given, the prefix defaults to the one specified at the compile time.

Definition at line 39 of file Layout.cc.

References Layout().

Referenced by main().

Layout * Layout::get ( void   )  [static]
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]
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.


Field Documentation

Definition at line 42 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 55 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 45 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 41 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 46 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 54 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 47 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 48 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 49 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 52 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 53 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 40 of file I_Layout.h.

Referenced by chdir_root(), Layout(), relative(), TSInstallDirGet(), and ~Layout().

Definition at line 51 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 43 of file I_Layout.h.

Referenced by Layout(), and ~Layout().

Definition at line 50 of file I_Layout.h.

Definition at line 44 of file I_Layout.h.

Referenced by Layout(), TSConfigDirGet(), and ~Layout().


The documentation for this struct was generated from the following files: