comparison libinterp/corefcn/sysdep.cc @ 20059:cf9b94a89620

Document get_home_directory in Octave manual and NEWS file. * NEWS: Add get_home_directory to list of new functions. * system.txi: Add get_home_directory to manual. * sysdep.cc(Fget_home_directory): Use preferred docstring format of single line summary sentence followed by second paragragh of explanation. Add BIST test.
author Rik <rik@octave.org>
date Thu, 02 Apr 2015 15:36:38 -0700
parents 47d420d769ba
children ab7582167810
comparison
equal deleted inserted replaced
20058:6babcfbe1a0a 20059:cf9b94a89620
1009 %! assert (tilde_expand ("foo/bar"), "foo/bar"); 1009 %! assert (tilde_expand ("foo/bar"), "foo/bar");
1010 */ 1010 */
1011 1011
1012 DEFUN (get_home_directory, , , 1012 DEFUN (get_home_directory, , ,
1013 "-*- texinfo -*-\n\ 1013 "-*- texinfo -*-\n\
1014 @deftypefn {Built-in Function} {} get_home_directory ()\n\ 1014 @deftypefn {Built-in Function} {@var{homedir} =} get_home_directory ()\n\
1015 Return the current home directory. On most systems, this is equivalent\n\ 1015 Return the current home directory.\n\
1016 to @code{getenv (\"HOME\")}. On Windows systems, if @env{HOME} is not\n\ 1016 \n\
1017 set in the environment, it is equivalent to\n\ 1017 On most systems, this is equivalent to @code{getenv (\"HOME\")}. On Windows\n\
1018 systems, if the environment variable @env{HOME} is not set then it is\n\
1019 equivalent to\n\
1018 @code{fullfile (getenv (\"HOMEDRIVE\"), getenv (\"HOMEPATH\"))}\n\ 1020 @code{fullfile (getenv (\"HOMEDRIVE\"), getenv (\"HOMEPATH\"))}\n\
1019 @seealso{getenv}\n\ 1021 @seealso{getenv}\n\
1020 @end deftypefn") 1022 @end deftypefn")
1021 { 1023 {
1022 return octave_value (octave_env::get_home_directory ()); 1024 return octave_value (octave_env::get_home_directory ());
1023 } 1025 }
1026
1027 /*
1028 %!test
1029 %! if (! ispc ())
1030 %! assert (get_home_directory (), getenv ("HOME"));
1031 %! endif
1032 */
1024 1033
1025 // This function really belongs in display.cc, but including defun.h in 1034 // This function really belongs in display.cc, but including defun.h in
1026 // that file results in conflicts with symbols from headers that are 1035 // that file results in conflicts with symbols from headers that are
1027 // needed for X11 and Carbon functions. 1036 // needed for X11 and Carbon functions.
1028 1037