|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <stdio.h>#include <stdlib.h>#include <limits.h>#include <string.h>#include "BinReloc.h"Go to the source code of this file.
Macros | |
| #define | __BINRELOC_C__ |
| #define | NULL ((void *) 0) /* typecasted as char* for C++ type safeness */ |
Functions | |
| int | br_init (BrInitError *error) |
| int | br_init_lib (BrInitError *error) |
| char * | br_find_exe (const char *default_exe) |
| char * | br_find_exe_dir (const char *default_dir) |
| char * | br_find_prefix (const char *default_prefix) |
| char * | br_find_bin_dir (const char *default_bin_dir) |
| char * | br_find_sbin_dir (const char *default_sbin_dir) |
| char * | br_find_data_dir (const char *default_data_dir) |
| char * | br_find_locale_dir (const char *default_locale_dir) |
| char * | br_find_lib_dir (const char *default_lib_dir) |
| char * | br_find_libexec_dir (const char *default_libexec_dir) |
| char * | br_find_etc_dir (const char *default_etc_dir) |
| char * | br_strcat (const char *str1, const char *str2) |
| char * | br_build_path (const char *dir, const char *file) |
| char * | br_dirname (const char *path) |
| #define __BINRELOC_C__ |
Definition at line 14 of file BinReloc.cpp.
| #define NULL ((void *) 0) /* typecasted as char* for C++ type safeness */ |
Definition at line 317 of file BinReloc.cpp.
| char * br_build_path | ( | const char * | dir, |
| const char * | file | ||
| ) |
Definition at line 718 of file BinReloc.cpp.
References br_strcat().
Referenced by br_find_bin_dir(), br_find_data_dir(), br_find_etc_dir(), br_find_lib_dir(), br_find_libexec_dir(), br_find_locale_dir(), and br_find_sbin_dir().
| char * br_dirname | ( | const char * | path | ) |
Extracts the directory component of a path.
Similar to g_dirname() or the dirname commandline application.
Example:
| path | A path. |
Definition at line 776 of file BinReloc.cpp.
References NULL.
Referenced by br_find_exe_dir(), and br_find_prefix().
| char * br_find_bin_dir | ( | const char * | default_bin_dir | ) |
Locate the application's binary folder.
The path is generated by the following pseudo-code evaluation:
| default_bin_dir | A default path which will used as fallback. |
Definition at line 466 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
| char * br_find_data_dir | ( | const char * | default_data_dir | ) |
Locate the application's data folder.
The path is generated by the following pseudo-code evaluation:
| default_data_dir | A default path which will used as fallback. |
Definition at line 533 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
Referenced by br_find_locale_dir().
| char * br_find_etc_dir | ( | const char * | default_etc_dir | ) |
Locate the application's configuration files folder.
The path is generated by the following pseudo-code evaluation:
| default_etc_dir | A default path which will used as fallback. |
Definition at line 665 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
| char * br_find_exe | ( | const char * | default_exe | ) |
Find the canonical filename of the current application.
| default_exe | A default filename which will be used as fallback. |
Definition at line 377 of file BinReloc.cpp.
References NULL.
Referenced by PEBLPath::Initialize(), and PEBLInterpret().
| char * br_find_exe_dir | ( | const char * | default_dir | ) |
Locate the directory in which the current application is installed.
The prefix is generated by the following pseudo-code evaluation:
| default_dir | A default directory which will used as fallback. |
Definition at line 405 of file BinReloc.cpp.
References br_dirname(), and NULL.
Referenced by PEBLPath::Initialize(), LauncherConfig::LauncherConfig(), and main().
| char * br_find_lib_dir | ( | const char * | default_lib_dir | ) |
Locate the application's library folder.
The path is generated by the following pseudo-code evaluation:
| default_lib_dir | A default path which will used as fallback. |
Definition at line 599 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
| char * br_find_libexec_dir | ( | const char * | default_libexec_dir | ) |
Locate the application's libexec folder.
The path is generated by the following pseudo-code evaluation:
| default_libexec_dir | A default path which will used as fallback. |
Definition at line 632 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
| char * br_find_locale_dir | ( | const char * | default_locale_dir | ) |
Locate the application's localization folder.
The path is generated by the following pseudo-code evaluation:
| default_locale_dir | A default path which will used as fallback. |
Definition at line 566 of file BinReloc.cpp.
References br_build_path(), br_find_data_dir(), and NULL.
| char * br_find_prefix | ( | const char * | default_prefix | ) |
Locate the prefix in which the current application is installed.
The prefix is generated by the following pseudo-code evaluation:
| default_prefix | A default prefix which will used as fallback. |
Definition at line 433 of file BinReloc.cpp.
References br_dirname(), and NULL.
Referenced by br_find_bin_dir(), br_find_data_dir(), br_find_etc_dir(), br_find_lib_dir(), br_find_libexec_dir(), br_find_sbin_dir(), and PEBLInterpret().
| char * br_find_sbin_dir | ( | const char * | default_sbin_dir | ) |
Locate the application's superuser binary folder.
The path is generated by the following pseudo-code evaluation:
| default_sbin_dir | A default path which will used as fallback. |
Definition at line 499 of file BinReloc.cpp.
References br_build_path(), br_find_prefix(), and NULL.
| int br_init | ( | BrInitError * | error | ) |
Initialize the BinReloc library (for applications).
This function must be called before using any other BinReloc functions. It attempts to locate the application's canonical filename.
| error | If BinReloc failed to initialize, then the error code will be stored in this variable. Set to NULL if you want to ignore this. See BrInitError for a list of error codes. |
Definition at line 338 of file BinReloc.cpp.
References NULL.
Referenced by PEBLPath::Initialize(), LauncherConfig::LauncherConfig(), main(), and PEBLInterpret().
| int br_init_lib | ( | BrInitError * | error | ) |
Initialize the BinReloc library (for libraries).
This function must be called before using any other BinReloc functions. It attempts to locate the calling library's canonical filename.
| error | If BinReloc failed to initialize, then the error code will be stored in this variable. Set to NULL if you want to ignore this. See BrInitError for a list of error codes. |
Definition at line 360 of file BinReloc.cpp.
References NULL.
| char * br_strcat | ( | const char * | str1, |
| const char * | str2 | ||
| ) |
Concatenate str1 and str2 to a newly allocated string.
| str1 | A string. |
| str2 | Another string. |
Definition at line 695 of file BinReloc.cpp.
References NULL.
Referenced by br_build_path().