comparison libinterp/corefcn/utils.cc @ 18070:ff05d5b70411

Deprecate find_dir_in_path in favor of dir_in_path. * NEWS: Announce deprecation of find_dir_in_path and new function dir_in_path. * scripts/deprecated/find_dir_in_path.m: Add script to call dir_in_path and give deprecation warning. * scripts/deprecated/module.mk: Add deprecated find_dir_in_path.m to build system. * utils.cc (Fdir_in_path): Renamed find_dir_in_path to dir_in_path. * help.m, what.m, rundemos.m, runtests.m: Chane instances of find_dir_in_path to dir_in_path. * utils.cc, variables.cc: Change seealso links to point to dir_in_path. * func.txi: Document dir_in_path function.
author Rik <rik@octave.org>
date Tue, 03 Dec 2013 15:59:56 -0800
parents aca545afdf25
children 1e27079409bf
comparison
equal deleted inserted replaced
18069:76006571e45a 18070:ff05d5b70411
301 the first that matches.\n\ 301 the first that matches.\n\
302 \n\ 302 \n\
303 If the second optional argument @qcode{\"all\"} is supplied, return\n\ 303 If the second optional argument @qcode{\"all\"} is supplied, return\n\
304 a cell array containing the list of all files that have the same\n\ 304 a cell array containing the list of all files that have the same\n\
305 name in the path. If no files are found, return an empty cell array.\n\ 305 name in the path. If no files are found, return an empty cell array.\n\
306 @seealso{file_in_path, find_dir_in_path, path}\n\ 306 @seealso{file_in_path, dir_in_path, path}\n\
307 @end deftypefn") 307 @end deftypefn")
308 { 308 {
309 octave_value retval; 309 octave_value retval;
310 310
311 int nargin = args.length (); 311 int nargin = args.length ();
378 the first that matches.\n\ 378 the first that matches.\n\
379 \n\ 379 \n\
380 If the third optional argument @qcode{\"all\"} is supplied, return\n\ 380 If the third optional argument @qcode{\"all\"} is supplied, return\n\
381 a cell array containing the list of all files that have the same\n\ 381 a cell array containing the list of all files that have the same\n\
382 name in the path. If no files are found, return an empty cell array.\n\ 382 name in the path. If no files are found, return an empty cell array.\n\
383 @seealso{file_in_loadpath, find_dir_in_path, path}\n\ 383 @seealso{file_in_loadpath, dir_in_path, path}\n\
384 @end deftypefn") 384 @end deftypefn")
385 { 385 {
386 octave_value retval; 386 octave_value retval;
387 387
388 int nargin = args.length (); 388 int nargin = args.length ();
890 890
891 %!error make_absolute_filename () 891 %!error make_absolute_filename ()
892 %!error make_absolute_filename ("foo", "bar") 892 %!error make_absolute_filename ("foo", "bar")
893 */ 893 */
894 894
895 DEFUN (find_dir_in_path, args, , 895 DEFUN (dir_in_path, args, ,
896 "-*- texinfo -*-\n\ 896 "-*- texinfo -*-\n\
897 @deftypefn {Built-in Function} {} find_dir_in_path (@var{dir})\n\ 897 @deftypefn {Built-in Function} {} dir_in_path (@var{dir})\n\
898 @deftypefnx {Built-in Function} {} find_dir_in_path (@var{dir}, \"all\")\n\ 898 @deftypefnx {Built-in Function} {} dir_in_path (@var{dir}, \"all\")\n\
899 Return the full name of the path element matching @var{dir}. The\n\ 899 Return the full name of the path element matching @var{dir}. The\n\
900 match is performed at the end of each path element. For example, if\n\ 900 match is performed at the end of each path element. For example, if\n\
901 @var{dir} is @qcode{\"foo/bar\"}, it matches the path element\n\ 901 @var{dir} is @qcode{\"foo/bar\"}, it matches the path element\n\
902 @nospell{@qcode{\"/some/dir/foo/bar\"}}, but not\n\ 902 @nospell{@qcode{\"/some/dir/foo/bar\"}}, but not\n\
903 @nospell{@qcode{\"/some/dir/foo/bar/baz\"}}\n\ 903 @nospell{@qcode{\"/some/dir/foo/bar/baz\"}}\n\
924 retval = load_path::find_dir (dir); 924 retval = load_path::find_dir (dir);
925 else if (nargin == 2) 925 else if (nargin == 2)
926 retval = Cell (load_path::find_matching_dirs (dir)); 926 retval = Cell (load_path::find_matching_dirs (dir));
927 } 927 }
928 else 928 else
929 error ("find_dir_in_path: DIR must be a directory name"); 929 error ("dir_in_path: DIR must be a directory name");
930 } 930 }
931 else 931 else
932 print_usage (); 932 print_usage ();
933 933
934 return retval; 934 return retval;
935 } 935 }
936 936
937 /* 937 /*
938 ## FIXME: We need system-dependent tests here. 938 ## FIXME: We need system-dependent tests here.
939 939
940 %!error find_dir_in_path () 940 %!error dir_in_path ()
941 %!error find_dir_in_path ("foo", "bar", 1) 941 %!error dir_in_path ("foo", "bar", 1)
942 */ 942 */
943 943
944 DEFUNX ("errno", Ferrno, args, , 944 DEFUNX ("errno", Ferrno, args, ,
945 "-*- texinfo -*-\n\ 945 "-*- texinfo -*-\n\
946 @deftypefn {Built-in Function} {@var{err} =} errno ()\n\ 946 @deftypefn {Built-in Function} {@var{err} =} errno ()\n\