Code::Blocks  SVN r11506
Macros | Functions
prefix.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BR_NAMESPACE(funcName)   funcName
 
#define br_strcat   BR_NAMESPACE(br_strcat)
 
#define br_extract_dir   BR_NAMESPACE(br_extract_dir)
 
#define br_extract_prefix   BR_NAMESPACE(br_extract_prefix)
 
#define BR_SELFPATH(suffix)   (br_thread_local_store (br_strcat (SELFPATH, suffix)))
 
#define BR_PREFIX(suffix)   (br_thread_local_store (br_strcat (PREFIX, suffix)))
 
#define BR_PREFIXDIR(suffix)   (br_thread_local_store (br_strcat (BR_PREFIX, suffix)))
 
#define BR_BINDIR(suffix)   (br_thread_local_store (br_strcat (BINDIR, suffix)))
 
#define BR_SBINDIR(suffix)   (br_thread_local_store (br_strcat (SBINDIR, suffix)))
 
#define BR_DATADIR(suffix)   (br_thread_local_store (br_strcat (DATADIR, suffix)))
 
#define BR_LIBDIR(suffix)   (br_thread_local_store (br_strcat (LIBDIR, suffix)))
 
#define BR_LIBEXECDIR(suffix)   (br_thread_local_store (br_strcat (LIBEXECDIR, suffix)))
 
#define BR_ETCDIR(suffix)   (br_thread_local_store (br_strcat (ETCDIR, suffix)))
 
#define BR_SYSCONFDIR(suffix)   (br_thread_local_store (br_strcat (SYSCONFDIR, suffix)))
 
#define BR_CONFDIR(suffix)   (br_thread_local_store (br_strcat (CONFDIR, suffix)))
 
#define BR_LOCALEDIR(suffix)   (br_thread_local_store (br_strcat (LOCALEDIR, suffix)))
 

Functions

char * br_strcat (const char *str1, const char *str2)
 br_strcat: str1: A string. More...
 
char * br_extract_dir (const char *path)
 br_extract_dir: path: A path. More...
 
char * br_extract_prefix (const char *path)
 br_extract_prefix: path: The full path of an executable or library. More...
 

Macro Definition Documentation

◆ BR_BINDIR

#define BR_BINDIR (   suffix)    (br_thread_local_store (br_strcat (BINDIR, suffix)))

Definition at line 102 of file prefix.h.

◆ BR_CONFDIR

#define BR_CONFDIR (   suffix)    (br_thread_local_store (br_strcat (CONFDIR, suffix)))

Definition at line 109 of file prefix.h.

◆ BR_DATADIR

#define BR_DATADIR (   suffix)    (br_thread_local_store (br_strcat (DATADIR, suffix)))

Definition at line 104 of file prefix.h.

◆ BR_ETCDIR

#define BR_ETCDIR (   suffix)    (br_thread_local_store (br_strcat (ETCDIR, suffix)))

Definition at line 107 of file prefix.h.

◆ br_extract_dir

#define br_extract_dir   BR_NAMESPACE(br_extract_dir)

Definition at line 94 of file prefix.h.

◆ br_extract_prefix

#define br_extract_prefix   BR_NAMESPACE(br_extract_prefix)

Definition at line 95 of file prefix.h.

◆ BR_LIBDIR

#define BR_LIBDIR (   suffix)    (br_thread_local_store (br_strcat (LIBDIR, suffix)))

Definition at line 105 of file prefix.h.

◆ BR_LIBEXECDIR

#define BR_LIBEXECDIR (   suffix)    (br_thread_local_store (br_strcat (LIBEXECDIR, suffix)))

Definition at line 106 of file prefix.h.

◆ BR_LOCALEDIR

#define BR_LOCALEDIR (   suffix)    (br_thread_local_store (br_strcat (LOCALEDIR, suffix)))

Definition at line 110 of file prefix.h.

◆ BR_NAMESPACE

#define BR_NAMESPACE (   funcName)    funcName

Definition at line 36 of file prefix.h.

◆ BR_PREFIX

#define BR_PREFIX (   suffix)    (br_thread_local_store (br_strcat (PREFIX, suffix)))

Definition at line 100 of file prefix.h.

◆ BR_PREFIXDIR

#define BR_PREFIXDIR (   suffix)    (br_thread_local_store (br_strcat (BR_PREFIX, suffix)))

Definition at line 101 of file prefix.h.

◆ BR_SBINDIR

#define BR_SBINDIR (   suffix)    (br_thread_local_store (br_strcat (SBINDIR, suffix)))

Definition at line 103 of file prefix.h.

◆ BR_SELFPATH

#define BR_SELFPATH (   suffix)    (br_thread_local_store (br_strcat (SELFPATH, suffix)))

Definition at line 99 of file prefix.h.

◆ br_strcat

#define br_strcat   BR_NAMESPACE(br_strcat)

Definition at line 93 of file prefix.h.

◆ BR_SYSCONFDIR

#define BR_SYSCONFDIR (   suffix)    (br_thread_local_store (br_strcat (SYSCONFDIR, suffix)))

Definition at line 108 of file prefix.h.

Function Documentation

◆ br_extract_dir()

char* br_extract_dir ( const char *  path)

br_extract_dir: path: A path.

Returns: A directory name. This string should be freed when no longer needed.

Extracts the directory component of path. Similar to g_dirname() or the dirname commandline application.

Example: br_extract_dir ("/usr/local/foobar"); –> Returns: "/usr/local"

Definition at line 379 of file prefix.cpp.

References br_return_val_if_fail, and br_strndup().

◆ br_extract_prefix()

char* br_extract_prefix ( const char *  path)

br_extract_prefix: path: The full path of an executable or library.

Returns: The prefix, or NULL on error. This string should be freed when no longer needed.

Extracts the prefix from path. This function assumes that your executable or library is installed in an LSB-compatible directory structure.

Example: br_extract_prefix ("/usr/bin/gnome-panel"); –> Returns "/usr" br_extract_prefix ("/usr/local/lib/libfoo.so"); –> Returns "/usr/local" br_extract_prefix ("/usr/local/libfoo.so"); –> Returns "/usr"

Definition at line 414 of file prefix.cpp.

References br_return_val_if_fail, and br_strndup().

◆ br_strcat()

char* br_strcat ( const char *  str1,
const char *  str2 
)

br_strcat: str1: A string.

str2: Another string. Returns: A newly-allocated string. This string should be freed when no longer needed.

Concatenate str1 and str2 to a newly allocated string.

Definition at line 334 of file prefix.cpp.