#include <cctype>
#include <cerrno>
#include <cstdlib>
#include <map>
#include <fstream>
#include <iostream>
#include <string>
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "kpse.h"
#include "oct-env.h"
#include "oct-passwd.h"
#include "oct-time.h"
#include "pathsearch.h"
#include "unistd-wrappers.h"
Go to the source code of this file.
Macros | |
#define | brace_whitespace(c) (! (c) || (c) == ' ' || (c) == '\t' || (c) == '\n') |
#define | DIR_SEP_STRING octave::sys::file_ops::dir_sep_str () |
#define | ENV_SEP octave::directory_path::path_sep_char () |
#define | ENV_SEP_STRING octave::directory_path::path_sep_str () |
#define | IS_DEVICE_SEP(ch) octave::sys::file_ops::is_dev_sep (ch) |
#define | IS_DIR_SEP(ch) octave::sys::file_ops::is_dir_sep (ch) |
#define | IS_ENV_SEP(ch) octave::directory_path::is_path_sep (ch) |
#define | IS_VAR_BEGIN_DELIMITER(c) ((c) == '{') |
#define | IS_VAR_CHAR(c) (isalnum (c) || (c) == '_') |
#define | IS_VAR_END_DELIMITER(c) ((c) == '}') |
#define | IS_VAR_START(c) ((c) == '$') |
#define | KPSE_DEBUG |
#define | KPSE_DEBUG_EXPAND 1 |
#define | KPSE_DEBUG_P(bit) (kpse_debug & (1 << (bit))) |
#define | KPSE_DEBUG_SEARCH 2 |
#define | KPSE_DEBUG_STAT 0 |
#define | KPSE_DEBUG_VARS 3 |
#define | KPSE_LAST_DEBUG KPSE_DEBUG_VARS |
#define | NAME_BEGINS_WITH_DEVICE(name) (name.length () > 0 && IS_DEVICE_SEP ((name)[1])) |
Variables | |
static int | brace_arg_separator = ',' |
static std::map< std::string, bool > | expansions |
static bool | first_search = true |
unsigned int | kpse_debug = 0 |
Definition at line 936 of file kpse.cc.
Referenced by brace_gobbler().
#define DIR_SEP_STRING octave::sys::file_ops::dir_sep_str () |
Definition at line 64 of file kpse.cc.
Referenced by kpse_element_dir(), and kpse_expand_kpse_dot().
#define ENV_SEP octave::directory_path::path_sep_char () |
Definition at line 67 of file kpse.cc.
Referenced by expand_amble(), and kpse_path_expand().
#define ENV_SEP_STRING octave::directory_path::path_sep_str () |
Definition at line 68 of file kpse.cc.
Referenced by kpse_brace_expand(), kpse_brace_expand_element(), kpse_expand_kpse_dot(), and kpse_path_expand().
#define IS_DEVICE_SEP | ( | ch | ) | octave::sys::file_ops::is_dev_sep (ch) |
Definition at line 60 of file kpse.cc.
Referenced by kpse_element_dir(), and kpse_truncate_filename().
#define IS_DIR_SEP | ( | ch | ) | octave::sys::file_ops::is_dir_sep (ch) |
Definition at line 65 of file kpse.cc.
Referenced by kpse_element_dir(), kpse_expand_kpse_dot(), kpse_path_expand(), kpse_tilde_expand(), kpse_truncate_filename(), path_find_first_of(), and path_search().
#define IS_ENV_SEP | ( | ch | ) | octave::directory_path::is_path_sep (ch) |
Definition at line 69 of file kpse.cc.
Referenced by kpse_expand_default().
Definition at line 1292 of file kpse.cc.
Referenced by kpse_var_expand().
Definition at line 1287 of file kpse.cc.
Referenced by kpse_var_expand().
Definition at line 1296 of file kpse.cc.
Referenced by kpse_var_expand().
Definition at line 1282 of file kpse.cc.
Referenced by kpse_var_expand().
#define KPSE_DEBUG_P | ( | bit | ) | (kpse_debug & (1 << (bit))) |
Definition at line 78 of file kpse.cc.
Referenced by find_first_of(), log_search(), and search().
#define KPSE_DEBUG_SEARCH 2 |
Definition at line 82 of file kpse.cc.
Referenced by find_first_of(), log_search(), and search().
#define KPSE_LAST_DEBUG KPSE_DEBUG_VARS |
#define NAME_BEGINS_WITH_DEVICE | ( | name | ) | (name.length () > 0 && IS_DEVICE_SEP ((name)[1])) |
Definition at line 61 of file kpse.cc.
Referenced by kpse_path_expand(), path_find_first_of(), and path_search().
|
static |
Definition at line 309 of file kpse.cc.
References found, kpse_readable_file(), name, and string.
Referenced by find_first_of(), and search().
|
static |
|
static |
Definition at line 977 of file kpse.cc.
References array_concat(), brace_gobbler(), c, expand_amble(), i, result, start, string, and text.
Referenced by expand_amble(), and kpse_brace_expand_element().
|
static |
Definition at line 1058 of file kpse.cc.
References brace_whitespace, c, and i.
Referenced by brace_expand(), and expand_amble().
|
static |
Definition at line 1188 of file kpse.cc.
References fs, and octave::sys::base_file_stat::is_dir().
Referenced by kpse_element_dir().
|
static |
Definition at line 285 of file kpse.cc.
References kpse_readable_file(), name, string, and tmp.
Referenced by path_find_first_of(), and path_search().
|
static |
Definition at line 1253 of file kpse.cc.
References expanding(), expanding_p(), octave::sys::env::getenv(), kpse_var_expand(), string, tmp, value, and var.
Referenced by kpse_var_expand().
|
static |
Definition at line 1023 of file kpse.cc.
References brace_arg_separator, brace_expand(), brace_gobbler(), c, ENV_SEP, i, result, start, and string.
Referenced by brace_expand().
|
static |
|
static |
|
static |
Definition at line 548 of file kpse.cc.
References absolute_search(), first_search, kpse_absolute_p(), KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, log_search(), name, p, and path_find_first_of().
Referenced by kpse_all_path_find_first_of(), and kpse_path_find_first_of().
|
static |
Definition at line 244 of file kpse.cc.
References octave::sys::env::absolute_pathname(), filename, and octave::sys::env::rooted_relative_pathname().
Referenced by find_first_of(), kpse_expand_kpse_dot(), and search().
std::list<std::string> kpse_all_path_find_first_of | ( | const std::string & | path, |
const std::list< std::string > & | names | ||
) |
Definition at line 644 of file kpse.cc.
References find_first_of().
Referenced by octave::directory_path::find_all_first_of().
std::list< std::string > kpse_all_path_search | ( | const std::string & | path, |
const std::string & | name | ||
) |
Definition at line 467 of file kpse.cc.
References name, and search().
Referenced by octave::directory_path::find_all().
|
static |
Definition at line 830 of file kpse.cc.
References ENV_SEP_STRING, kpse_brace_expand_element(), kpse_expand_kpse_dot(), kpse_var_expand(), octave::math::pi, string, and tmp.
Referenced by kpse_path_expand().
|
static |
Definition at line 797 of file kpse.cc.
References brace_expand(), ENV_SEP_STRING, expansions, kpse_expand(), string, and x.
Referenced by kpse_brace_expand().
std::string kpse_element_dir | ( | const std::string & | elt | ) |
Definition at line 1203 of file kpse.cc.
References dir_p(), DIR_SEP_STRING, IS_DEVICE_SEP, IS_DIR_SEP, and string.
Referenced by octave::directory_path::all_directories(), kpse_path_expand(), path_find_first_of(), and path_search().
|
static |
Definition at line 746 of file kpse.cc.
References kpse_tilde_expand(), kpse_var_expand(), s, and string.
Referenced by kpse_brace_expand_element(), and search().
std::string kpse_expand_default | ( | const std::string & | path, |
const std::string & | fallback | ||
) |
Definition at line 1136 of file kpse.cc.
References i, IS_ENV_SEP, and string.
Referenced by octave::directory_path::init().
|
static |
Definition at line 759 of file kpse.cc.
References DIR_SEP_STRING, ENV_SEP_STRING, octave::sys::env::getenv(), IS_DIR_SEP, kpse_absolute_p(), octave::math::pi, and string.
Referenced by kpse_brace_expand().
std::string kpse_path_expand | ( | const std::string & | path | ) |
Definition at line 865 of file kpse.cc.
References ENV_SEP, ENV_SEP_STRING, IS_DIR_SEP, kpse_brace_expand(), kpse_element_dir(), NAME_BEGINS_WITH_DEVICE, octave::math::pi, string, and tmp.
Referenced by octave::directory_path::init().
std::string kpse_path_find_first_of | ( | const std::string & | path, |
const std::list< std::string > & | names | ||
) |
Definition at line 628 of file kpse.cc.
References find_first_of().
Referenced by octave::directory_path::find_first_of().
std::string kpse_path_search | ( | const std::string & | path, |
const std::string & | name | ||
) |
Definition at line 456 of file kpse.cc.
References name, and search().
Referenced by octave::directory_path::find_first().
|
static |
Definition at line 203 of file kpse.cc.
References kpse_truncate_filename(), name, READABLE(), and string.
Referenced by absolute_search(), and dir_search().
|
static |
Definition at line 655 of file kpse.cc.
References c, octave::sys::env::get_home_directory(), octave::sys::password::getpwnam(), IS_DIR_SEP, name, p, and string.
Referenced by kpse_expand().
|
static |
Definition at line 132 of file kpse.cc.
References i, IS_DEVICE_SEP, IS_DIR_SEP, octave::sys::dir_entry::max_name_length(), name, and string.
Referenced by kpse_readable_file().
|
static |
Definition at line 1303 of file kpse.cc.
References expand(), i, IS_VAR_BEGIN_DELIMITER, IS_VAR_CHAR, IS_VAR_END_DELIMITER, IS_VAR_START, and string.
Referenced by expand(), kpse_brace_expand(), and kpse_expand().
|
static |
Definition at line 262 of file kpse.cc.
References filename, KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, now, and octave::sys::time::unix_time().
Referenced by find_first_of(), and search().
std::list<std::string> path_find_first_of | ( | const std::string & | path, |
const std::list< std::string > & | names, | ||
bool | all | ||
) |
Definition at line 477 of file kpse.cc.
References dir_search(), done, first_search, found, IS_DIR_SEP, kpse_element_dir(), name, NAME_BEGINS_WITH_DEVICE, octave::math::pi, and string.
Referenced by find_first_of().
|
static |
Definition at line 325 of file kpse.cc.
References dir_search(), done, first_search, found, IS_DIR_SEP, kpse_element_dir(), name, NAME_BEGINS_WITH_DEVICE, octave::math::pi, and string.
Referenced by search().
|
inlinestatic |
Definition at line 179 of file kpse.cc.
References fs, octave::sys::base_file_stat::is_dir(), octave_access_r_ok(), octave_access_wrapper(), retval, and t.
Referenced by kpse_readable_file().
|
static |
Definition at line 395 of file kpse.cc.
References absolute_search(), first_search, kpse_absolute_p(), KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, kpse_expand(), log_search(), name, path_search(), and string.
Referenced by octave::documentation::documentation(), kpse_all_path_search(), and kpse_path_search().
|
static |
Definition at line 1016 of file kpse.cc.
Referenced by expand_amble().
|
static |
Definition at line 1232 of file kpse.cc.
Referenced by expanding(), expanding_p(), and kpse_brace_expand_element().
|
static |
Definition at line 257 of file kpse.cc.
Referenced by find_first_of(), path_find_first_of(), path_search(), and search().
unsigned int kpse_debug = 0 |
Definition at line 88 of file kpse.cc.
Referenced by octave::directory_path::init().