Mercurial > octave
diff scripts/image/private/imageIO.m @ 30893:e1788b1a315f
maint: Use "fcn" as preferred abbreviation for "function" in m-files.
* accumarray.m, accumdim.m, quadl.m, quadv.m, randi.m, structfun.m,
__is_function__.m, uigetfile.m, uimenu.m, uiputfile.m, doc_cache_create.m,
colorspace_conversion_input_check.m, imageIO.m, argnames.m, vectorize.m,
vectorize.m, normest1.m, inputname.m, nthargout.m, display_info_file.m,
decic.m, ode15i.m, ode15s.m, ode23.m, ode23s.m, ode45.m, odeset.m,
check_default_input.m, integrate_adaptive.m, ode_event_handler.m,
runge_kutta_23.m, runge_kutta_23s.m, runge_kutta_45_dorpri.m,
runge_kutta_interpolate.m, starting_stepsize.m, __all_opts__.m, fminbnd.m,
fminsearch.m, fminunc.m, fsolve.m, fzero.m, sqp.m, fplot.m, plotyy.m,
__bar__.m, __ezplot__.m, flat_entry.html, profexport.m, movfun.m, bicg.m,
bicgstab.m, cgs.m, eigs.m, gmres.m, pcg.m, __alltohandles__.m, __sprand__.m,
qmr.m, tfqmr.m, dump_demos.m:
Replace "func", "fun", "fn" in documentation and variable names with "fcn".
author | Rik <rik@octave.org> |
---|---|
date | Mon, 04 Apr 2022 18:14:56 -0700 |
parents | 796f54d4ddbf |
children | 505ed551e366 |
line wrap: on
line diff
--- a/scripts/image/private/imageIO.m Mon Apr 04 11:22:26 2022 -0700 +++ b/scripts/image/private/imageIO.m Mon Apr 04 18:14:56 2022 -0700 @@ -35,8 +35,8 @@ ## ## Usage: ## -## func - Function name to use on error message. -## core_func - Function handle for the default function to use if we can't +## fcn - Function name to use on error message. +## core_fcn - Function handle for the default function to use if we can't ## find the format in imformats. ## fieldname - Name of the field in the struct returned by imformats that ## has the function to use. @@ -46,7 +46,7 @@ ## varargin - Followed by all the OTHER arguments passed to imread and ## imfinfo. -function varargout = imageIO (func, core_func, fieldname, filename, varargin) +function varargout = imageIO (fcn, core_fcn, fieldname, filename, varargin) ## First thing: figure out the filename and possibly download it. ## The first attempt is to try the filename and see if it exists. If it @@ -77,7 +77,7 @@ endif if (isempty (fn)) - error ([func ": unable to find file '" filename "'"]); + error ([fcn ": unable to find file '" filename "'"]); endif ## unwind_protect block because we may have a file to remove in the end @@ -89,7 +89,7 @@ ## try to guess the format from the file extension. Finally, if ## we still don't know the format, we use the Octave core functions ## which is the same for all formats. - foo = []; # the function we will use + hfcn = []; # the function we will use ## We check if the call to imformats (ext) worked using ## "numfields (fmt) > 0 because when it fails, the returned @@ -99,13 +99,13 @@ if (! isempty (varargin) && ischar (varargin{1})) fmt = imformats (varargin{1}); if (numfields (fmt) > 0) - foo = fmt.(fieldname); + hfcn = fmt.(fieldname); varargin(1) = []; # remove format name from arguments endif endif ## try extension from filename - if (isempty (foo)) + if (isempty (hfcn)) [~, ~, ext] = fileparts (fn); if (! isempty (ext)) ## remove dot from extension @@ -113,16 +113,16 @@ endif fmt = imformats (ext); if (numfields (fmt) > 0) - foo = fmt.(fieldname); + hfcn = fmt.(fieldname); endif endif ## use the core function - if (isempty (foo)) - foo = core_func; + if (isempty (hfcn)) + hfcn = core_fcn; endif - [varargout{1:nargout}] = foo (fn, varargin{:}); + [varargout{1:nargout}] = hfcn (fn, varargin{:}); unwind_protect_cleanup if (file_2_delete)