#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 | 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])) |
Functions | |
static std::list< std::string > | absolute_search (const std::string &name) |
static std::list< std::string > | array_concat (const std::list< std::string > &arr1, const std::list< std::string > &arr2) |
static std::list< std::string > | brace_expand (const std::string &text) |
static int | brace_gobbler (const std::string &, int &, int) |
static bool | dir_p (const std::string &fn) |
static std::list< std::string > | dir_search (const std::string &dir, const std::string &name, bool search_all) |
static std::list< std::string > | expand_amble (const std::string &) |
static std::list< std::string > | find_first_of (const std::string &path, const std::list< std::string > &names, bool all) |
static bool | kpse_absolute_p (const std::string &filename, int relative_ok) |
std::list< std::string > | kpse_all_path_find_first_of (const std::string &path, const std::list< std::string > &names) |
std::list< std::string > | kpse_all_path_search (const std::string &path, const std::string &name) |
std::string | kpse_element_dir (const std::string &elt) |
std::string | kpse_path_expand (const std::string &path) |
std::string | kpse_path_find_first_of (const std::string &path, const std::list< std::string > &names) |
std::string | kpse_path_search (const std::string &path, const std::string &name) |
static std::string | kpse_readable_file (const std::string &name) |
static std::string | kpse_tilde_expand (const std::string &name) |
static std::string | kpse_truncate_filename (const std::string &name) |
static void | log_search (const std::list< std::string > &filenames) |
std::list< std::string > | path_find_first_of (const std::string &path, const std::list< std::string > &names, bool all) |
static std::list< std::string > | path_search (const std::string &path, const std::string &name, bool all) |
static bool | READABLE (const std::string &fn) |
static std::list< std::string > | search (const std::string &path, const std::string &original_name, bool all) |
Variables | |
static int | brace_arg_separator = ',' |
static bool | first_search = true |
unsigned int | kpse_debug = 0 |
#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 KPSE_DEBUG_P | ( | bit | ) | (kpse_debug & (1 << (bit))) |
#define KPSE_LAST_DEBUG KPSE_DEBUG_VARS |
#define NAME_BEGINS_WITH_DEVICE | ( | name | ) | (name.length () > 0 && IS_DEVICE_SEP ((name)[1])) |
|
static |
Definition at line 311 of file kpse.cc.
References kpse_readable_file(), and name.
Referenced by find_first_of(), and search().
|
static |
Definition at line 829 of file kpse.cc.
Referenced by brace_expand().
|
static |
Definition at line 853 of file kpse.cc.
References array_concat(), brace_gobbler(), and expand_amble().
Referenced by expand_amble().
|
static |
Definition at line 934 of file kpse.cc.
References brace_whitespace.
Referenced by brace_expand(), and expand_amble().
|
static |
Definition at line 1007 of file kpse.cc.
References octave::sys::base_file_stat::is_dir().
Referenced by kpse_element_dir().
|
static |
Definition at line 287 of file kpse.cc.
References kpse_readable_file(), and name.
Referenced by path_find_first_of(), and path_search().
|
static |
Definition at line 899 of file kpse.cc.
References brace_arg_separator, brace_expand(), brace_gobbler(), and ENV_SEP.
Referenced by brace_expand().
|
static |
Definition at line 639 of file kpse.cc.
References absolute_search(), first_search, kpse_absolute_p(), KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, log_search(), name, path, and path_find_first_of().
Referenced by kpse_all_path_find_first_of(), and kpse_path_find_first_of().
|
static |
Definition at line 246 of file kpse.cc.
References octave::sys::env::absolute_pathname(), and octave::sys::env::rooted_relative_pathname().
Referenced by find_first_of(), 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 735 of file kpse.cc.
References find_first_of(), and path.
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 | ||
) |
std::string kpse_element_dir | ( | const std::string & | elt | ) |
Definition at line 1022 of file kpse.cc.
References dir_p(), DIR_SEP_STRING, IS_DEVICE_SEP, and IS_DIR_SEP.
Referenced by octave::directory_path::all_directories(), kpse_path_expand(), path_find_first_of(), and path_search().
std::string kpse_path_expand | ( | const std::string & | path | ) |
Definition at line 746 of file kpse.cc.
References ENV_SEP, ENV_SEP_STRING, IS_DIR_SEP, kpse_element_dir(), kpse_tilde_expand(), len, NAME_BEGINS_WITH_DEVICE, path, and octave::math::pi.
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 719 of file kpse.cc.
References find_first_of(), and path.
Referenced by octave::directory_path::find_first_of().
std::string kpse_path_search | ( | const std::string & | path, |
const std::string & | name | ||
) |
|
static |
Definition at line 205 of file kpse.cc.
References kpse_truncate_filename(), name, and READABLE().
Referenced by absolute_search(), and dir_search().
|
static |
Definition at line 393 of file kpse.cc.
References octave::sys::password::dir(), octave::sys::env::get_home_directory(), octave::sys::password::getpwnam(), IS_DIR_SEP, and name.
Referenced by kpse_path_expand(), and search().
|
static |
Definition at line 132 of file kpse.cc.
References IS_DEVICE_SEP, IS_DIR_SEP, octave::sys::dir_entry::max_name_length(), and name.
Referenced by kpse_readable_file().
|
static |
Definition at line 264 of file kpse.cc.
References KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, 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 568 of file kpse.cc.
References dir_search(), first_search, IS_DIR_SEP, kpse_element_dir(), name, NAME_BEGINS_WITH_DEVICE, path, and octave::math::pi.
Referenced by find_first_of().
|
static |
Definition at line 327 of file kpse.cc.
References dir_search(), first_search, IS_DIR_SEP, kpse_element_dir(), name, NAME_BEGINS_WITH_DEVICE, path, and octave::math::pi.
Referenced by search().
|
inlinestatic |
Definition at line 170 of file kpse.cc.
References octave::sys::base_file_stat::is_dir(), octave_access_r_ok(), octave_access_wrapper(), retval, and octave::sys::u8_to_wstring().
Referenced by kpse_readable_file().
|
static |
Definition at line 486 of file kpse.cc.
References absolute_search(), first_search, kpse_absolute_p(), KPSE_DEBUG_P, KPSE_DEBUG_SEARCH, kpse_tilde_expand(), log_search(), name, path, and path_search().
Referenced by octave::documentation::documentation(), Faudioformats(), kpse_all_path_search(), and kpse_path_search().
|
static |
Definition at line 892 of file kpse.cc.
Referenced by expand_amble().
|
static |
Definition at line 259 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 92 of file kpse.cc.
Referenced by octave::directory_path::init().