27 #if ! defined (octave_shared_fcns_h) 28 #define octave_shared_fcns_h 1 32 #if defined (OCTAVE_USE_WINDOWS_API) 37 #if defined (_MSC_VER) 39 # define pclose _pclose 43 w32_get_octave_home (
void)
49 char namebuf[MAX_PATH+1];
50 if (GetModuleFileName (GetModuleHandle (NULL), namebuf, MAX_PATH))
52 namebuf[MAX_PATH] =
'\0';
55 size_t pos = exe_name.rfind (
'\\');
57 if (pos != std::string::npos)
58 bin_dir = exe_name.substr (0, pos + 1);
63 size_t pos =
bin_dir.rfind (R
"(\bin\)"); 65 if (pos != std::string::npos)
77 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ 78 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) 84 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) 110 #if defined (OCTAVE_USE_WINDOWS_API) 112 oh = w32_get_octave_home ();
127 else if (op == oep && ! oh.empty ())
141 size_t len =
s.length ();
149 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) 150 if ((len == 2 && isalpha (
s[0]) &&
s[1] ==
':')
151 || (len > 2 && isalpha (
s[0]) &&
s[1] ==
':' static std::string dir_sep_chars
static void set_octave_home(void)
static std::string prepend_octave_exec_home(const std::string &s)
static std::string prepend_home_dir(const std::string &hd, const std::string &s)
static std::string Voctave_exec_home
#define OCTAVE_EXEC_PREFIX
static bool is_dir_sep(char c)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
std::string bin_dir(void)
nd deftypefn *std::string name
static bool absolute_pathname(const std::string &s)
static std::string Voctave_home
static const char dir_sep_char
static OCTAVE_UNUSED std::string prepend_octave_home(const std::string &s)
static std::string octave_getenv(const std::string &name)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
nd group nd example For each display the value