annotate libinterp/corefcn/sysdep.cc @ 24534:194eb4bd202b

maint: Update punctuation for GPL v3 license text. * COPYING, Makefile.am, README, bootstrap, bootstrap.conf, OctJavaQry.java, changelog.tmpl, check-subst-vars.in.sh, find-defun-files.sh, find-files-with-tests.sh, get-source-mtime.sh, mk-hg-id.sh, mk-octave-config-h.sh, mk-opts.pl, stl_algo.h-fixed, subst-config-vals.in.sh, subst-cross-config-vals.in.sh, subst-default-vals.in.sh, subst-script-vals.in.sh, configure.ac, Doxyfile.in, arith.txi, audio.txi, basics.txi, bugs.txi, config-images.sh, container.txi, cp-idx.txi, data.txi, debug.txi, diagperm.txi, diffeq.txi, add_to_aspell_dict, mk_undocumented_list, spellcheck, errors.txi, eval.txi, expr.txi, external.txi, fn-idx.txi, func.txi, genpropdoc.m, geometry.txi, geometryimages.m, grammar.txi, gui.txi, image.txi, images.awk, install.txi, interp.txi, interpimages.m, intro.txi, io.txi, linalg.txi, macros.texi, matrix.txi, mk-doc-cache.pl, mkcontrib.awk, mkoctfile.1, munge-texi.pl, nonlin.txi, numbers.txi, obsolete.txi, octave-cli.1, octave-config.1, octave.1, octave.css, octave.texi, oop.txi, op-idx.txi, optim.txi, package.txi, plot.txi, plotimages.m, poly.txi, preface.txi, quad.txi, set.txi, signal.txi, sparse.txi, sparseimages.m, splineimages.m, stats.txi, stmt.txi, strings.txi, system.txi, testfun.txi, var.txi, vectorize.txi, array.texi, bugs.texi, cp-idx.texi, dae.texi, diffeq.texi, error.texi, factor.texi, fn-idx.texi, gpl.texi, install.texi, intro.texi, liboctave.texi, matvec.texi, nleqn.texi, nlfunc.texi, ode.texi, optim.texi, preface.texi, quad.texi, range.texi, refcard-a4.tex, refcard-legal.tex, refcard-letter.tex, refcard.tex, HACKING.md, octave.appdata.xml.in, Backend.cc, Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h, ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, MouseModeActionGroup.cc, MouseModeActionGroup.h, Object.cc, Object.h, ObjectFactory.cc, ObjectFactory.h, ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc, TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, __init_qt__.cc, __init_qt__.h, annotation-dialog.cc, annotation-dialog.h, gl-select.cc, gl-select.h, liboctgui-build-info.h, liboctgui-build-info.in.cc, mk-default-qt-settings.in.sh, QTerminal.cc, QTerminal.h, BlockArray.cpp, BlockArray.h, Character.h, CharacterColor.h, Emulation.cpp, Emulation.h, Filter.cpp, Filter.h, History.cpp, History.h, KeyboardTranslator.cpp, KeyboardTranslator.h, QUnixTerminalImpl.cpp, QUnixTerminalImpl.h, Screen.cpp, Screen.h, ScreenWindow.cpp, ScreenWindow.h, SelfListener.cpp, SelfListener.h, TerminalCharacterDecoder.cpp, TerminalCharacterDecoder.h, TerminalModel.cpp, TerminalModel.h, TerminalView.cpp, TerminalView.h, Vt102Emulation.cpp, Vt102Emulation.h, kpty.cpp, kpty.h, kpty_p.h, QTerminalColors.cpp, QTerminalColors.h, QWinTerminalImpl.cpp, QWinTerminalImpl.h, main.cpp, color-picker.cc, color-picker.h, dialog.cc, dialog.h, documentation-dock-widget.cc, documentation-dock-widget.h, external-editor-interface.cc, external-editor-interface.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc, find-files-dialog.h, find-files-model.cc, find-files-model.h, history-dock-widget.cc, history-dock-widget.h, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h, octave-cmd.cc, octave-cmd.h, octave-dock-widget.cc, octave-dock-widget.h, octave-gui.cc, octave-gui.h, octave-qt-link.cc, octave-qt-link.h, octave-settings.h, texinfo-parser.cc, texinfo-parser.h, webinfo.cc, webinfo.h, resource-manager.cc, resource-manager.h, settings-dialog.cc, settings-dialog.h, shortcut-manager.cc, shortcut-manager.h, terminal-dock-widget.cc, terminal-dock-widget.h, thread-manager.cc, thread-manager.h, variable-editor-model.cc, variable-editor-model.h, variable-editor.cc, variable-editor.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h, build-env.h, build-env.in.cc, builtins.h, Cell.cc, Cell.h, __contourc__.cc, __dsearchn__.cc, __ichol__.cc, __ilu__.cc, __lin_interpn__.cc, __luinc__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, balance.cc, base-text-renderer.h, besselj.cc, betainc.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h, call-stack.cc, call-stack.h, cdisplay.c, cdisplay.h, cellfun.cc, coct-hdf5-types.c, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc, default-defs.in.h, defaults.cc, defaults.h, defun-dld.h, defun-int.h, defun.cc, defun.h, det.cc, dirfns.cc, dirfns.h, display.cc, display.h, dlmread.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc, ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.cc, errwarn.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, file-io.h, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h, gammainc.cc, gcd.cc, genprops.awk, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h, graphics-handle.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, graphics.in.h, gripes.cc, gripes.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc, help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h, inv.cc, kron.cc, load-path.cc, load-path.h, load-save.cc, load-save.h, lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-hdf5.cc, ls-hdf5.h, ls-mat-ascii.cc, ls-mat-ascii.h, ls-mat4.cc, ls-mat4.h, ls-mat5.cc, ls-mat5.h, ls-oct-binary.cc, ls-oct-binary.h, ls-oct-text.cc, ls-oct-text.h, ls-utils.cc, ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex.cc, mex.h, mexproto.h, mgorth.cc, mk-errno-list.sh, mk-mxarray-h.in.sh, mxarray.in.h, nproc.cc, oct-errno.h, oct-errno.in.cc, oct-fstrm.cc, oct-fstrm.h, oct-handle.h, oct-hdf5-types.cc, oct-hdf5-types.h, oct-hdf5.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h, oct-map.cc, oct-map.h, oct-obj.h, oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.in.yy, oct.h, octave-default-image.h, octave-link.cc, octave-link.h, ordschur.cc, pager.cc, pager.h, pinv.cc, pr-output.cc, pr-output.h, procstream.cc, procstream.h, psi.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc, sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symrec.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h, text-renderer.cc, text-renderer.h, time.cc, toplev.cc, toplev.h, tril.cc, tsearch.cc, txt-eng.cc, txt-eng.h, typecast.cc, url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc, variables.h, workspace-element.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h, zfstream.cc, zfstream.h, deprecated-config.h, __delaunayn__.cc, __eigs__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc, config-module.awk, config-module.sh, convhulln.cc, dmperm.cc, fftw.cc, gzip.cc, oct-qhull.h, qr.cc, symbfact.cc, symrcm.cc, liboctinterp-build-info.h, liboctinterp-build-info.in.cc, mk-build-env-features.sh, mk-builtins.pl, mk-doc.pl, mk-pkg-add.sh, mk-version-h.in.sh, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc, ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc, ov-bool.h, ov-builtin.cc, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc, ov-ch-mat.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h, ov-colon.cc, ov-colon.h, ov-complex.cc, ov-complex.h, ov-cs-list.cc, ov-cs-list.h, ov-cx-diag.cc, ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h, ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn-inline.cc, ov-fcn-inline.h, ov-fcn.cc, ov-fcn.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h, ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h, ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-flt-re-mat.h, ov-int-traits.h, ov-int16.cc, ov-int16.h, ov-int32.cc, ov-int32.h, ov-int64.cc, ov-int64.h, ov-int8.cc, ov-int8.h, ov-intx.h, ov-java.cc, ov-java.h, ov-lazy-idx.cc, ov-lazy-idx.h, ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-null-mat.h, ov-oncleanup.cc, ov-oncleanup.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc, ov-re-diag.h, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h, ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-str-mat.h, ov-struct.cc, ov-struct.h, ov-typeinfo.cc, ov-typeinfo.h, ov-uint16.cc, ov-uint16.h, ov-uint32.cc, ov-uint32.h, ov-uint64.cc, ov-uint64.h, ov-uint8.cc, ov-uint8.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.cc, ovl.h, octave.cc, octave.h, op-kw-docs, mk-ops.sh, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cdm-cm.cc, op-cdm-cs.cc, op-cdm-dm.cc, op-cdm-m.cc, op-cdm-s.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cdm.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-dm.cc, op-cm-m.cc, op-cm-pm.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-cdm.cc, op-dm-cm.cc, op-dm-cs.cc, op-dm-dm.cc, op-dm-m.cc, op-dm-s.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcdm-fcm.cc, op-fcdm-fcs.cc, op-fcdm-fdm.cc, op-fcdm-fm.cc, op-fcdm-fs.cc, op-fcm-fcdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fdm.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcm-pm.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fcdm.cc, op-fdm-fcm.cc, op-fdm-fcs.cc, op-fdm-fdm.cc, op-fdm-fm.cc, op-fdm-fs.cc, op-fm-fcdm.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fdm.cc, op-fm-fm.cc, op-fm-fs.cc, op-fm-pm.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-int.h, op-m-cdm.cc, op-m-cm.cc, op-m-cs.cc, op-m-dm.cc, op-m-m.cc, op-m-pm.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-pm-cm.cc, op-pm-fcm.cc, op-pm-fm.cc, op-pm-m.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h, options-usage.h, bp-table.cc, bp-table.h, comment-list.cc, comment-list.h, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, jit-util.cc, jit-util.h, lex.h, lex.ll, oct-lvalue.cc, oct-lvalue.h, oct-parse.in.yy, octave.gperf, parse.h, profiler.cc, profiler.h, pt-all.h, pt-arg-list.cc, pt-arg-list.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-funcall.cc, pt-funcall.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jit.cc, pt-jit.h, pt-jump.cc, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Array-jit.cc, Array-tc.cc, version.cc, version.in.h, Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc, Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc, Array-util.h, Array-voidp.cc, Array.cc, Array.h, CColVector.cc, CColVector.h, CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc, CMatrix.h, CNDArray.cc, CNDArray.h, CRowVector.cc, CRowVector.h, CSparse.cc, CSparse.h, DiagArray2.cc, DiagArray2.h, MArray-C.cc, MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc, MArray-s.cc, MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse-C.cc, MSparse-d.cc, MSparse.cc, MSparse.h, Matrix.h, MatrixType.cc, MatrixType.h, PermMatrix.cc, PermMatrix.h, Range.cc, Range.h, Sparse-C.cc, Sparse-b.cc, Sparse-d.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h, boolNDArray.cc, boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.cc, chMatrix.h, chNDArray.cc, chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc, dDiagMatrix.h, dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc, dRowVector.h, dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h, fCColVector.cc, fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc, fCMatrix.h, fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h, fColVector.cc, fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc, fMatrix.h, fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc, idx-vector.h, int16NDArray.cc, int16NDArray.h, int32NDArray.cc, int32NDArray.h, int64NDArray.cc, int64NDArray.h, int8NDArray.cc, int8NDArray.h, intNDArray.cc, intNDArray.h, uint16NDArray.cc, uint16NDArray.h, uint32NDArray.cc, uint32NDArray.h, uint64NDArray.cc, uint64NDArray.h, uint8NDArray.cc, uint8NDArray.h, cconv2.f, cdotc3.f, cmatm3.f, csconv2.f, dconv2.f, ddot3.f, dmatm3.f, sconv2.f, sdot3.f, smatm3.f, zconv2.f, zdconv2.f, zdotc3.f, zmatm3.f, crsf2csf.f, zrsf2csf.f, mk-f77-def.in.sh, liboctave-build-info.h, liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h, DAERTFunc.h, DASPK-opts.in, DASPK.cc, DASPK.h, DASRT-opts.in, DASRT.cc, DASRT.h, DASSL-opts.in, DASSL.cc, DASSL.h, DET.h, EIG.cc, EIG.h, LSODE-opts.in, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h, ODES.cc, ODES.h, ODESFunc.h, Quad-opts.in, Quad.cc, Quad.h, aepbalance.cc, aepbalance.h, base-dae.h, base-de.h, base-min.h, bsxfun-decl.h, bsxfun-defs.cc, bsxfun.h, chol.cc, chol.h, eigs-base.cc, eigs-base.h, fEIG.cc, fEIG.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-amos-proto.h, lo-arpack-proto.h, lo-blas-proto.h, lo-fftpack-proto.h, lo-lapack-proto.h, lo-mappers.cc, lo-mappers.h, lo-qrupdate-proto.h, lo-ranlib-proto.h, lo-slatec-proto.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-dmsolve.cc, sparse-dmsolve.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, Sparse-diag-op-defs.h, Sparse-op-decls.h, Sparse-op-defs.h, Sparse-perm-op-defs.h, config-ops.sh, mk-ops.awk, mx-base.h, mx-defs.h, mx-ext.h, mx-inlines.cc, mx-op-decl.h, mx-op-defs.h, mx-ops, smx-ops, vx-ops, child-list.cc, child-list.h, cmach-info.c, cmach-info.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h, oct-passwd.cc, oct-passwd.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h, action-container.h, base-list.h, blaswrap.c, byte-swap.h, caseless-str.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, cquit.c, data-conv.cc, data-conv.h, f2c-main.c, f77-fcn.c, f77-fcn.h, file-info.cc, file-info.h, functor.h, glob-match.cc, glob-match.h, kpse.cc, kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-array-gripes.cc, lo-array-gripes.h, lo-cutils.c, lo-cutils.h, lo-error.c, lo-error.h, lo-hash.cc, lo-hash.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-traits.h, lo-utils.cc, lo-utils.h, oct-base64.cc, oct-base64.h, oct-binmap.h, oct-cmplx.h, oct-glob.cc, oct-glob.h, oct-inttypes-fwd.h, oct-inttypes.cc, oct-inttypes.h, oct-locbuf.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-rl-edit.c, oct-rl-edit.h, oct-rl-hist.c, oct-rl-hist.h, oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sort.h, oct-sparse.cc, oct-sparse.h, oct-string.cc, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc, quit.h, singleton-cleanup.cc, singleton-cleanup.h, sparse-sort.cc, sparse-sort.h, sparse-util.cc, sparse-util.h, str-vec.cc, str-vec.h, sun-utils.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h, areadlink-wrapper.c, areadlink-wrapper.h, async-system-wrapper.c, async-system-wrapper.h, base64-wrappers.c, base64-wrappers.h, canonicalize-file-name-wrapper.c, canonicalize-file-name-wrapper.h, dirent-wrappers.c, dirent-wrappers.h, fcntl-wrappers.c, fcntl-wrappers.h, filepos-wrappers.c, filepos-wrappers.h, fpucw-wrappers.c, fpucw-wrappers.h, gen-tempname-wrapper.c, gen-tempname-wrapper.h, getopt-wrapper.c, getopt-wrapper.h, glob-wrappers.c, glob-wrappers.h, hash-wrappers.c, hash-wrappers.h, localcharset-wrapper.c, localcharset-wrapper.h, math-wrappers.c, math-wrappers.h, mkostemp-wrapper.c, mkostemp-wrapper.h, nanosleep-wrapper.c, nanosleep-wrapper.h, nproc-wrapper.c, nproc-wrapper.h, octave-popen2.c, octave-popen2.h, putenv-wrapper.c, putenv-wrapper.h, set-program-name-wrapper.c, set-program-name-wrapper.h, signal-wrappers.c, signal-wrappers.h, stat-wrappers.c, stat-wrappers.h, strdup-wrapper.c, strdup-wrapper.h, strftime-wrapper.c, strftime-wrapper.h, strmode-wrapper.c, strmode-wrapper.h, strptime-wrapper.c, strptime-wrapper.h, time-wrappers.c, time-wrappers.h, tmpfile-wrapper.c, tmpfile-wrapper.h, uname-wrapper.c, uname-wrapper.h, uniconv-wrappers.c, uniconv-wrappers.h, unistd-wrappers.c, unistd-wrappers.h, unsetenv-wrapper.c, unsetenv-wrapper.h, vasprintf-wrapper.c, vasprintf-wrapper.h, wait-for-input.c, wait-for-input.h, wait-wrappers.c, wait-wrappers.h, acinclude.m4, ax_blas.m4, ax_lapack.m4, ax_openmp.m4, ax_pthread.m4, octave_blas_f77_func.m4, pkg.m4, oct-conf-post.in.h, run-octave.in, Map.m, ascii.m, binary.m, cd.m, close.m, delete.m, dir.m, disp.m, ftp.m, loadobj.m, mget.m, mkdir.m, mput.m, rename.m, rmdir.m, saveobj.m, __get_properties__.m, audioplayer.m, disp.m, get.m, isplaying.m, pause.m, play.m, playblocking.m, resume.m, set.m, stop.m, subsasgn.m, subsref.m, __get_properties__.m, audiorecorder.m, disp.m, get.m, getaudiodata.m, getplayer.m, isrecording.m, pause.m, play.m, record.m, recordblocking.m, resume.m, set.m, stop.m, subsasgn.m, subsref.m, lin2mu.m, mu2lin.m, record.m, sound.m, soundsc.m, bitmax.m, chop.m, comma.m, isstr.m, mahalanobis.m, md5sum.m, octave_config_info.m, onenormest.m, paren.m, semicolon.m, sleep.m, usleep.m, wavread.m, wavwrite.m, acosd.m, acot.m, acotd.m, acoth.m, acsc.m, acscd.m, acsch.m, asec.m, asecd.m, asech.m, asind.m, atan2d.m, atand.m, cosd.m, cot.m, cotd.m, coth.m, csc.m, cscd.m, csch.m, sec.m, secd.m, sech.m, sind.m, tand.m, accumarray.m, accumdim.m, bincoeff.m, bitcmp.m, bitget.m, bitset.m, blkdiag.m, cart2pol.m, cart2sph.m, cell2mat.m, celldisp.m, circshift.m, common_size.m, cplxpair.m, cumtrapz.m, curl.m, dblquad.m, deal.m, deg2rad.m, del2.m, divergence.m, flip.m, flipdim.m, fliplr.m, flipud.m, gradient.m, idivide.m, int2str.m, integral.m, integral2.m, integral3.m, interp1.m, interp2.m, interp3.m, interpft.m, interpn.m, isequal.m, isequaln.m, logspace.m, nextpow2.m, num2str.m, pol2cart.m, polyarea.m, postpad.m, prepad.m, __splinen__.m, quad2d.m, quadgk.m, quadl.m, quadv.m, rad2deg.m, randi.m, rat.m, repelem.m, repmat.m, rot90.m, rotdim.m, shift.m, shiftdim.m, sortrows.m, sph2cart.m, structfun.m, subsindex.m, trapz.m, triplequad.m, xor.m, convhull.m, delaunay.m, delaunayn.m, dsearch.m, dsearchn.m, griddata.m, griddata3.m, griddatan.m, inpolygon.m, rectint.m, tsearchn.m, voronoi.m, voronoin.m, dialog.m, errordlg.m, getappdata.m, guidata.m, guihandles.m, helpdlg.m, inputdlg.m, isappdata.m, listdlg.m, msgbox.m, __file_filter__.m, __fltk_file_filter__.m, __get_funcname__.m, __is_function__.m, __uigetdir_fltk__.m, __uigetfile_fltk__.m, __uiobject_split_args__.m, __uiputfile_fltk__.m, questdlg.m, rmappdata.m, setappdata.m, uibuttongroup.m, uicontextmenu.m, uicontrol.m, uigetdir.m, uigetfile.m, uimenu.m, uipanel.m, uipushtool.m, uiputfile.m, uiresume.m, uitoggletool.m, uitoolbar.m, uiwait.m, waitbar.m, waitforbuttonpress.m, warndlg.m, __gripe_missing_component__.m, __makeinfo__.m, __unimplemented__.m, ans.m, debug.m, doc.m, doc_cache_create.m, error_ids.m, get_first_help_sentence.m, help.m, lookfor.m, print_usage.m, __additional_help_message__.m, __strip_html_tags__.m, slash.m, type.m, warning_ids.m, which.m, autumn.m, bone.m, brighten.m, cmpermute.m, cmunique.m, colorcube.m, colormap.m, contrast.m, cool.m, copper.m, cubehelix.m, flag.m, frame2im.m, getframe.m, gray.m, gray2ind.m, hot.m, hsv.m, hsv2rgb.m, im2double.m, im2frame.m, image.m, imagesc.m, imfinfo.m, imformats.m, imread.m, imshow.m, imwrite.m, ind2gray.m, ind2rgb.m, iscolormap.m, jet.m, lines.m, ntsc2rgb.m, ocean.m, pink.m, prism.m, __imfinfo__.m, __imread__.m, __imwrite__.m, colorspace_conversion_input_check.m, colorspace_conversion_revert.m, imageIO.m, imwrite_filename.m, ind2x.m, rainbow.m, rgb2hsv.m, rgb2ind.m, rgb2ntsc.m, rgbplot.m, spinmap.m, spring.m, summer.m, viridis.m, white.m, winter.m, beep.m, csvread.m, csvwrite.m, dlmwrite.m, fileread.m, importdata.m, is_valid_file_id.m, strread.m, textread.m, javaArray.m, java_get.m, java_set.m, javaaddpath.m, javachk.m, javaclasspath.m, javamem.m, javarmpath.m, ClassHelper.java, Matrix.java, OctClassLoader.java, Octave.java, OctaveReference.java, usejava.m, bandwidth.m, commutation_matrix.m, cond.m, condeig.m, condest.m, cross.m, duplication_matrix.m, expm.m, gls.m, housh.m, isbanded.m, isdefinite.m, isdiag.m, ishermitian.m, issymmetric.m, istril.m, istriu.m, krylov.m, linsolve.m, logm.m, lscov.m, normest.m, normest1.m, null.m, ols.m, orth.m, planerot.m, qzhess.m, rank.m, rref.m, subspace.m, trace.m, vech.m, vecnorm.m, bug_report.m, bunzip2.m, cast.m, citation.m, compare_versions.m, computer.m, copyfile.m, delete.m, desktop.m, dir.m, dos.m, edit.m, fact.m, fieldnames.m, fileattrib.m, fileparts.m, fullfile.m, genvarname.m, getfield.m, grabcode.m, gunzip.m, info.m, inputParser.m, inputname.m, isdeployed.m, isdir.m, ismac.m, ispc.m, isunix.m, license.m, list_primes.m, loadobj.m, ls.m, ls_command.m, menu.m, methods.m, mex.m, mexext.m, mkdir.m, mkoctfile.m, movefile.m, namelengthmax.m, nargchk.m, narginchk.m, nargoutchk.m, news.m, nthargout.m, open.m, orderfields.m, pack.m, parseparams.m, perl.m, __publish_html_output__.m, __publish_latex_output__.m, __w2mpth__.m, display_info_file.m, publish.m, python.m, recycle.m, run.m, saveobj.m, setfield.m, substruct.m, swapbytes.m, symvar.m, tar.m, tempdir.m, tmpnam.m, unix.m, unpack.m, untar.m, unzip.m, validateattributes.m, ver.m, version.m, what.m, zip.m, mk-doc.pl, mk-pkg-add.sh, decic.m, ode15i.m, ode15s.m, ode23.m, ode45.m, odeget.m, odeplot.m, odeset.m, AbsRel_norm.m, check_default_input.m, integrate_adaptive.m, kahan.m, ode_event_handler.m, odedefaults.m, odemergeopts.m, runge_kutta_23.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, glpk.m, humps.m, lsqnonneg.m, optimget.m, optimset.m, pqpnonneg.m, __fdjac__.m, qp.m, sqp.m, import.m, matlabroot.m, pathdef.m, getsavepath.m, savepath.m, pkg.m, build.m, configure_make.m, default_prefix.m, describe.m, dirempty.m, get_description.m, get_forge_download.m, get_forge_pkg.m, get_unsatisfied_deps.m, getarch.m, getarchdir.m, install.m, installed_packages.m, list_forge_packages.m, load_packages.m, load_packages_and_dependencies.m, rebuild.m, save_order.m, uninstall.m, unload_packages.m, __clabel__.m, __getlegenddata__.m, __rotate_around_axis__.m, annotation.m, axis.m, box.m, camlookat.m, camorbit.m, campos.m, camroll.m, camtarget.m, camup.m, camva.m, camzoom.m, caxis.m, clabel.m, daspect.m, datetick.m, diffuse.m, grid.m, gtext.m, hidden.m, legend.m, lighting.m, material.m, orient.m, pbaspect.m, __axis_label__.m, __axis_limits__.m, rticks.m, shading.m, specular.m, text.m, thetaticks.m, title.m, view.m, whitebg.m, xlabel.m, xlim.m, xticklabels.m, xticks.m, ylabel.m, ylim.m, yticklabels.m, yticks.m, zlabel.m, zlim.m, zticklabels.m, zticks.m, area.m, bar.m, barh.m, camlight.m, colorbar.m, comet.m, comet3.m, compass.m, contour.m, contour3.m, contourc.m, contourf.m, cylinder.m, ellipsoid.m, errorbar.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m, ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fill.m, fplot.m, hist.m, isocaps.m, isocolors.m, isonormals.m, isosurface.m, light.m, line.m, loglog.m, loglogerr.m, mesh.m, meshc.m, meshz.m, pareto.m, patch.m, pcolor.m, peaks.m, pie.m, pie3.m, plot.m, plot3.m, plotmatrix.m, plotyy.m, polar.m, __add_datasource__.m, __bar__.m, __calc_isovalue_from_data__.m, __contour__.m, __errplot__.m, __ezplot__.m, __interp_cube__.m, __line__.m, __marching_cube__.m, __patch__.m, __pie__.m, __plt__.m, __quiver__.m, __scatter__.m, __stem__.m, __unite_shared_vertices__.m, quiver.m, quiver3.m, rectangle.m, reducepatch.m, reducevolume.m, ribbon.m, rose.m, scatter.m, scatter3.m, semilogx.m, semilogxerr.m, semilogy.m, semilogyerr.m, shrinkfaces.m, slice.m, smooth3.m, sombrero.m, sphere.m, stairs.m, stem.m, stem3.m, stemleaf.m, surf.m, surface.m, surfc.m, surfl.m, surfnorm.m, tetramesh.m, trimesh.m, triplot.m, trisurf.m, waterfall.m, __actual_axis_position__.m, __default_plot_options__.m, __gnuplot_drawnow__.m, __next_line_color__.m, __next_line_style__.m, __opengl_info__.m, __plt_get_axis_arg__.m, __pltopt__.m, allchild.m, ancestor.m, axes.m, cla.m, clf.m, close.m, closereq.m, colstyle.m, copyobj.m, figure.m, findall.m, findfigs.m, findobj.m, gca.m, gcbf.m, gcbo.m, gcf.m, gco.m, ginput.m, gnuplot_binary.in.m, graphics_toolkit.m, groot.m, hdl2struct.m, hggroup.m, hgload.m, hgsave.m, hgtransform.m, hold.m, isaxes.m, isfigure.m, isgraphics.m, ishandle.m, ishold.m, isprop.m, linkaxes.m, linkprop.m, meshgrid.m, ndgrid.m, newplot.m, pan.m, print.m, printd.m, __add_default_menu__.m, __ghostscript__.m, __gnuplot_draw_axes__.m, __gnuplot_draw_figure__.m, __gnuplot_get_var__.m, __gnuplot_ginput__.m, __gnuplot_has_feature__.m, __gnuplot_has_terminal__.m, __gnuplot_open_stream__.m, __gnuplot_print__.m, __gnuplot_version__.m, __opengl_print__.m, __print_parse_opts__.m, __set_default_mouse_modes__.m, refresh.m, refreshdata.m, rotate.m, rotate3d.m, saveas.m, shg.m, struct2hdl.m, subplot.m, zoom.m, compan.m, conv.m, deconv.m, mkpp.m, mpoles.m, padecoef.m, pchip.m, poly.m, polyaffine.m, polyder.m, polyeig.m, polyfit.m, polygcd.m, polyint.m, polyout.m, polyreduce.m, polyval.m, polyvalm.m, ppder.m, ppint.m, ppjumps.m, ppval.m, residue.m, roots.m, spline.m, splinefit.m, unmkpp.m, addpref.m, getpref.m, ispref.m, prefdir.m, preferences.m, loadprefs.m, prefsfile.m, saveprefs.m, rmpref.m, setpref.m, style.css, profexplore.m, profexport.m, profile.m, profshow.m, intersect.m, ismember.m, powerset.m, validsetargs.m, setdiff.m, setxor.m, union.m, unique.m, arch_fit.m, arch_rnd.m, arch_test.m, arma_rnd.m, autoreg_matrix.m, bartlett.m, blackman.m, detrend.m, diffpara.m, durbinlevinson.m, fftconv.m, fftfilt.m, fftshift.m, filter2.m, fractdiff.m, freqz.m, freqz_plot.m, hamming.m, hanning.m, hurst.m, ifftshift.m, periodogram.m, rectangle_lw.m, rectangle_sw.m, triangle_lw.m, triangle_sw.m, sinc.m, sinetone.m, sinewave.m, spectral_adf.m, spectral_xdf.m, spencer.m, stft.m, synthesis.m, unwrap.m, yulewalker.m, bicg.m, bicgstab.m, cgs.m, colperm.m, eigs.m, etreeplot.m, gmres.m, gplot.m, ichol.m, ilu.m, nonzeros.m, pcg.m, pcr.m, __sprand__.m, qmr.m, spaugment.m, spconvert.m, spdiags.m, speye.m, spfun.m, spones.m, sprand.m, sprandn.m, sprandsym.m, spstats.m, spy.m, svds.m, treelayout.m, treeplot.m, bessel.m, beta.m, betaln.m, ellipke.m, expint.m, factor.m, factorial.m, isprime.m, lcm.m, legendre.m, nchoosek.m, nthroot.m, perms.m, pow2.m, primes.m, reallog.m, realpow.m, realsqrt.m, gallery.m, hadamard.m, hankel.m, hilb.m, invhilb.m, magic.m, pascal.m, rosser.m, toeplitz.m, vander.m, wilkinson.m, __finish__.m, center.m, cloglog.m, corr.m, corrcoef.m, cov.m, crosstab.m, histc.m, iqr.m, kendall.m, kurtosis.m, logit.m, mean.m, meansq.m, median.m, mode.m, moment.m, ppplot.m, prctile.m, probit.m, qqplot.m, quantile.m, range.m, ranks.m, run_count.m, runlength.m, skewness.m, spearman.m, statistics.m, std.m, var.m, zscore.m, betacdf.m, betainv.m, betapdf.m, betarnd.m, binocdf.m, binoinv.m, binopdf.m, binornd.m, cauchy_cdf.m, cauchy_inv.m, cauchy_pdf.m, cauchy_rnd.m, chi2cdf.m, chi2inv.m, chi2pdf.m, chi2rnd.m, discrete_cdf.m, discrete_inv.m, discrete_pdf.m, discrete_rnd.m, empirical_cdf.m, empirical_inv.m, empirical_pdf.m, empirical_rnd.m, expcdf.m, expinv.m, exppdf.m, exprnd.m, fcdf.m, finv.m, fpdf.m, frnd.m, gamcdf.m, gaminv.m, gampdf.m, gamrnd.m, geocdf.m, geoinv.m, geopdf.m, geornd.m, hygecdf.m, hygeinv.m, hygepdf.m, hygernd.m, kolmogorov_smirnov_cdf.m, laplace_cdf.m, laplace_inv.m, laplace_pdf.m, laplace_rnd.m, logistic_cdf.m, logistic_inv.m, logistic_pdf.m, logistic_rnd.m, logncdf.m, logninv.m, lognpdf.m, lognrnd.m, nbincdf.m, nbininv.m, nbinpdf.m, nbinrnd.m, normcdf.m, norminv.m, normpdf.m, normrnd.m, poisscdf.m, poissinv.m, poisspdf.m, poissrnd.m, stdnormal_cdf.m, stdnormal_inv.m, stdnormal_pdf.m, stdnormal_rnd.m, tcdf.m, tinv.m, tpdf.m, trnd.m, unidcdf.m, unidinv.m, unidpdf.m, unidrnd.m, unifcdf.m, unifinv.m, unifpdf.m, unifrnd.m, wblcdf.m, wblinv.m, wblpdf.m, wblrnd.m, wienrnd.m, logistic_regression.m, logistic_regression_derivatives.m, logistic_regression_likelihood.m, anova.m, bartlett_test.m, chisquare_test_homogeneity.m, chisquare_test_independence.m, cor_test.m, f_test_regression.m, hotelling_test.m, hotelling_test_2.m, kolmogorov_smirnov_test.m, kolmogorov_smirnov_test_2.m, kruskal_wallis_test.m, manova.m, mcnemar_test.m, prop_test_2.m, run_test.m, sign_test.m, t_test.m, t_test_2.m, t_test_regression.m, u_test.m, var_test.m, welch_test.m, wilcoxon_test.m, z_test.m, z_test_2.m, base2dec.m, bin2dec.m, blanks.m, cstrcat.m, deblank.m, dec2base.m, dec2bin.m, dec2hex.m, erase.m, findstr.m, hex2dec.m, index.m, isletter.m, isstring.m, isstrprop.m, mat2str.m, native2unicode.m, ostrsplit.m, regexptranslate.m, rindex.m, str2num.m, strcat.m, strchr.m, strjoin.m, strjust.m, strmatch.m, strsplit.m, strtok.m, strtrim.m, strtrunc.m, substr.m, unicode2native.m, untabify.m, validatestring.m, __have_feature__.m, __printf_assert__.m, __prog_output_assert__.m, __run_test_suite__.m, assert.m, demo.m, example.m, fail.m, compare_plot_demos.m, dump_demos.m, html_compare_plot_demos.m, rundemos.m, runtests.m, speed.m, test.m, addtodate.m, asctime.m, calendar.m, clock.m, ctime.m, date.m, datenum.m, datestr.m, datevec.m, eomday.m, etime.m, is_leap_year.m, now.m, weekday.m, display-available.c, display-available.h, main-cli.cc, main-gui.cc, main.in.cc, mkoctfile.in.cc, octave-build-info.h, octave-build-info.in.cc, octave-config.in.cc, shared-fcns.h, args.tst, bug-31371.tst, bug-35448.tst, bug-35881.tst, bug-36025.tst, bug-38236.tst, bug-38565.tst, bug-38576.tst, bug-38691.tst, bug-41723.tst, bug-44940.tst, bug-46330.tst, bug-46660.tst, bug-50014.tst, bug-50035.tst, bug-50716.tst, bug-51192.tst, bug-51532.tst, bug-51534.tst, bug-51599.tst, bug-52075.tst, class-concat.tst, classdef-multiple-inheritance.tst, classdef.tst, classes.tst, colormaps.tst, command.tst, complex.tst, ctor-vs-method.tst, deprecate-props.tst, diag-perm.tst, error.tst, eval-catch.tst, fcn-handle-derived-resolution.tst, fntests.m, for.tst, func.tst, global.tst, if.tst, index.tst, io.tst, jit.tst, leftdiv.tst, line-continue.tst, logical-index.tst, mk-bc-overloads-tst.sh, mk-conv-tst.sh, mk-sparse-tst.sh, nest.tst, null-assign.tst, parser.tst, prefer.tst, publish.tst, range.tst, recursion.tst, return.tst, show-failures.awk, single-index.tst, slice.tst, struct.tst, switch.tst, system.tst, transpose.tst, try.tst, unwind.tst, while.tst: Changed punctuation of GPL license text to match that suggested by FSF.
author Rik <rik@octave.org>
date Sat, 06 Jan 2018 07:57:19 -0800
parents 98a03a1097b4
children a829062fdea4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 1993-2017 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24442
diff changeset
7 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
8 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24442
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
10 (at your option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22417
diff changeset
15 GNU General Public License for more details.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6960
diff changeset
18 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24442
diff changeset
19 <https://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21662
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
24 # include "config.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
23662
bd77ab816e43 eliminate obsolete file lo-math.h
John W. Eaton <jwe@octave.org>
parents: 23575
diff changeset
27 #include <cmath>
1343
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1318
diff changeset
28 #include <cstddef>
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1318
diff changeset
29
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3372
diff changeset
30 #include <iostream>
1728
42b4f904f1af [project @ 1996-01-09 11:36:01 by jwe]
jwe
parents: 1711
diff changeset
31 #include <string>
42b4f904f1af [project @ 1996-01-09 11:36:01 by jwe]
jwe
parents: 1711
diff changeset
32
1430
045e70a15a8f [project @ 1995-09-19 07:05:37 by jwe]
jwe
parents: 1415
diff changeset
33 #if defined (HAVE_TERMIOS_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
34 # include <termios.h>
1430
045e70a15a8f [project @ 1995-09-19 07:05:37 by jwe]
jwe
parents: 1415
diff changeset
35 #elif defined (HAVE_TERMIO_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
36 # include <termio.h>
1430
045e70a15a8f [project @ 1995-09-19 07:05:37 by jwe]
jwe
parents: 1415
diff changeset
37 #elif defined (HAVE_SGTTY_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
38 # include <sgtty.h>
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
39 #endif
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
40
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
41 #if defined (HAVE_CONIO_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
42 # include <conio.h>
1430
045e70a15a8f [project @ 1995-09-19 07:05:37 by jwe]
jwe
parents: 1415
diff changeset
43 #endif
045e70a15a8f [project @ 1995-09-19 07:05:37 by jwe]
jwe
parents: 1415
diff changeset
44
3248
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 3234
diff changeset
45 #if defined (HAVE_SYS_IOCTL_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
46 # include <sys/ioctl.h>
3248
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 3234
diff changeset
47 #endif
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 3234
diff changeset
48
1463
592291d9dfbb [project @ 1995-09-22 07:18:44 by jwe]
jwe
parents: 1430
diff changeset
49 #if defined (HAVE_FLOATINGPOINT_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
50 # include <floatingpoint.h>
1463
592291d9dfbb [project @ 1995-09-22 07:18:44 by jwe]
jwe
parents: 1430
diff changeset
51 #endif
592291d9dfbb [project @ 1995-09-22 07:18:44 by jwe]
jwe
parents: 1430
diff changeset
52
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
53 #if defined (HAVE_IEEEFP_H)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
54 # include <ieeefp.h>
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
55 #endif
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
56
21554
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
57 #if defined (HAVE_OMP_H)
21556
12f207a534aa maint: merge stable to default.
John W. Eaton <jwe@octave.org>
parents: 21301 21554
diff changeset
58 # include <omp.h>
21554
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
59 #endif
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
60
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2893
diff changeset
61 #include "cmd-edit.h"
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2893
diff changeset
62 #include "file-ops.h"
2893
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2847
diff changeset
63 #include "lo-mappers.h"
2317
8c09c04f7747 [project @ 1996-07-14 22:30:15 by jwe]
jwe
parents: 2086
diff changeset
64 #include "mach-info.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2893
diff changeset
65 #include "oct-env.h"
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21888
diff changeset
66 #include "unistd-wrappers.h"
21888
00f1249f2483 create wrappers for some gnulib functions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
67 #include "unsetenv-wrapper.h"
1769
bc7ae9be3378 [project @ 1996-01-23 06:49:08 by jwe]
jwe
parents: 1755
diff changeset
68
22097
5ad67277b007 include builtin-defun-decls.h as needed
John W. Eaton <jwe@octave.org>
parents: 22096
diff changeset
69 #include "builtin-defun-decls.h"
6208
323be5eeed1f [project @ 2006-12-06 20:23:18 by jwe]
jwe
parents: 6135
diff changeset
70 #include "Cell.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
71 #include "defun.h"
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
72 #include "error.h"
21115
629643522cc0 include errwarn.h in all files that use gripe_disabled_feature
John W. Eaton <jwe@octave.org>
parents: 21109
diff changeset
73 #include "errwarn.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
74 #include "input.h"
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 22051
diff changeset
75 #include "octave.h"
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 22051
diff changeset
76 #include "ov.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20939
diff changeset
77 #include "ovl.h"
3234
be8e0ba13644 [project @ 1999-01-29 03:52:30 by jwe]
jwe
parents: 3124
diff changeset
78 #include "pager.h"
6419
73fcbac81f33 [project @ 2007-03-20 17:18:24 by jwe]
jwe
parents: 6208
diff changeset
79 #include "parse.h"
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
80 #include "sighandlers.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
81 #include "sysdep.h"
22094
9203833cab7d move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents: 22089
diff changeset
82 #include "interpreter.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
83 #include "utils.h"
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
84 #include "file-stat.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
85
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21662
diff changeset
86 #if ! defined (STDIN_FILENO)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
87 # define STDIN_FILENO 1
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
88 #endif
444
ba637cc5c5f3 [project @ 1994-06-02 17:15:07 by jwe]
jwe
parents: 401
diff changeset
89
9441
160c564d5d25 initialize floating point values properly for NetBSD systems
Aleksej Saushev <asau@inbox.ru>
parents: 9411
diff changeset
90 #if defined (__386BSD__) || defined (__FreeBSD__) || defined (__NetBSD__)
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
91 static void
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
92 BSD_init (void)
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
93 {
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
94 # if defined (HAVE_FLOATINGPOINT_H)
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
95 // Disable trapping on common exceptions.
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21662
diff changeset
96 # if ! defined (FP_X_DNML)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
97 # define FP_X_DNML 0
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
98 # endif
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
99 fpsetmask (~(FP_X_OFL|FP_X_INV|FP_X_DZ|FP_X_DNML|FP_X_UFL|FP_X_IMP));
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 21115
diff changeset
100 # endif
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
101 }
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
102 #endif
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
103
22019
2d8e9bdf5683 Dont use OCTAVE_USE_WINDOWS_API for w32_XXXX function definitions (Bug #48352)
John Donoghue
parents: 21989
diff changeset
104 #if defined (__MINGW32__) || defined (_MSC_VER)
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
105
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
106 #define WIN32_LEAN_AND_MEAN
21949
baeffde5c87d fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents: 21910
diff changeset
107 #include <windows.h>
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
108 #include <tlhelp32.h>
21949
baeffde5c87d fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents: 21910
diff changeset
109 #include <shellapi.h>
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
110
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
111 static void
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
112 w32_set_octave_home (void)
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
113 {
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
114 std::string bin_dir;
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
115
13885
2f42a7b0cf94 Fix MinGW compilation problem with tlhelp32.h
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13771
diff changeset
116 HANDLE h = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21662
diff changeset
117 #if defined (TH32CS_SNAPMODULE32)
13885
2f42a7b0cf94 Fix MinGW compilation problem with tlhelp32.h
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13771
diff changeset
118 | TH32CS_SNAPMODULE32
2f42a7b0cf94 Fix MinGW compilation problem with tlhelp32.h
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13771
diff changeset
119 #endif
2f42a7b0cf94 Fix MinGW compilation problem with tlhelp32.h
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13771
diff changeset
120 , 0);
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
121
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
122 if (h != INVALID_HANDLE_VALUE)
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
123 {
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
124 MODULEENTRY32 mod_info;
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
125
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
126 ZeroMemory (&mod_info, sizeof (mod_info));
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
127 mod_info.dwSize = sizeof (mod_info);
13751
be7ff59cbc7a Fix octinterp DLL searching on Win32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13282
diff changeset
128
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
129 if (Module32First (h, &mod_info))
14445
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
130 {
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
131 do
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
132 {
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
133 std::string mod_name (mod_info.szModule);
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
134
14445
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
135 if (mod_name.find ("octinterp") != std::string::npos)
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
136 {
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
137 bin_dir = mod_info.szExePath;
23812
057a894914df Use C++11 string fcns back() and pop_back() to simplify code.
Rik <rik@octave.org>
parents: 23809
diff changeset
138 if (! bin_dir.empty () && bin_dir.back () != '\\')
057a894914df Use C++11 string fcns back() and pop_back() to simplify code.
Rik <rik@octave.org>
parents: 23809
diff changeset
139 bin_dir.push_back ('\\');
14445
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
140 break;
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
141 }
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
142 }
b50654a09ba7 maint: untabify sources
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
143 while (Module32Next (h, &mod_info));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
144 }
13771
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
145
80b30e186b73 [Win32] Use Toolhelp32 APi to find octinterp module path.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13751
diff changeset
146 CloseHandle (h);
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
147 }
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
148
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
149 if (! bin_dir.empty ())
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
150 {
23804
8057d3f0673d Use C++11 raw string literals to avoid escaping backslashes in strings.
Rik <rik@octave.org>
parents: 23746
diff changeset
151 size_t pos = bin_dir.rfind (R"(\bin\)");
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
152
8021
85184151822e fix typo in NPOS change
John W. Eaton <jwe@octave.org>
parents: 8019
diff changeset
153 if (pos != std::string::npos)
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
154 octave::sys::env::putenv ("OCTAVE_HOME", bin_dir.substr (0, pos));
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
155 }
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
156 }
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
157
19302
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
158 static void
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
159 w32_init (void)
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
160 {
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
161 w32_set_octave_home ();
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
162
21748
176536b15d68 use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents: 21739
diff changeset
163 octave::command_editor::prefer_env_winsize (true);
19302
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
164 }
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
165
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
166 #endif
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
167
22165
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
168 // Set app id if we have the SetCurrentProcessExplicitAppUserModelID
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
169 // available (>= Win7). FIXME: Could we check for existence of this
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
170 // function in the configure script instead of dynamically loading
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
171 // shell32.dll?
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
172
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
173 void
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
174 set_application_id (void)
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
175 {
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
176 #if defined (__MINGW32__) || defined (_MSC_VER)
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
177
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
178 typedef HRESULT (WINAPI *SETCURRENTAPPID)(PCWSTR AppID);
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
179
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
180 HMODULE hShell = LoadLibrary ("shell32.dll");
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
181
23459
ddcbf10c8c39 maint: Use C++11 nullptr rather than 0 or NULL for remaining instances in code.
Rik <rik@octave.org>
parents: 23455
diff changeset
182 if (hShell)
22165
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
183 {
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
184 SETCURRENTAPPID pfnSetCurrentProcessExplicitAppUserModelID =
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
185 reinterpret_cast<SETCURRENTAPPID> (GetProcAddress (hShell,
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
186 "SetCurrentProcessExplicitAppUserModelID"));
22165
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
187
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
188 if (pfnSetCurrentProcessExplicitAppUserModelID)
23319
fc344de3afc9 Set version on AppUserModelId (Bug #50428)
John D
parents: 23219
diff changeset
189 pfnSetCurrentProcessExplicitAppUserModelID (L"gnu.octave." VERSION);
22165
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
190
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
191 FreeLibrary (hShell);
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
192 }
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
193
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
194 #endif
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
195 }
20e684ec108e move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents: 22141
diff changeset
196
19856
5c1a38089f89 Change open_with_system_app to internal function.
Rik <rik@octave.org>
parents: 19849
diff changeset
197 DEFUN (__open_with_system_app__, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
198 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
199 @deftypefn {} {} __open_with_system_app__ (@var{file})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
200 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
201 @end deftypefn */)
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
202 {
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
203 if (args.length () != 1)
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
204 print_usage ();
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
205
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
206 std::string file = args(0).xstring_value ("__open_with_system_app__: argument must be a filename");
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
207
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
208 octave_value retval;
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
209
21979
d04da18a407a use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents: 21966
diff changeset
210 #if defined (OCTAVE_USE_WINDOWS_API)
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
211 HINSTANCE status = ShellExecute (0, 0, file.c_str (), 0, 0,
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
212 SW_SHOWNORMAL);
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
213
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
214 // ShellExecute returns a value greater than 32 if successful.
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
215 retval = (reinterpret_cast<ptrdiff_t> (status) > 32);
20961
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
216 #elif defined (__APPLE__)
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
217 octave_value_list tmp
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
218 = Fsystem (ovl ("open " + file + " 2> /dev/null",
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
219 false, "async"),
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
220 1);
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
221
20961
f55251db0833 Add support for the Mac OS X "open" command.
Ben Abbott <bpabbott@mac.com>
parents: 20941
diff changeset
222 retval = (tmp(0).double_value () == 0);
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
223 #else
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
224 octave_value_list tmp
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
225 = Fsystem (ovl ("xdg-open " + file + " 2> /dev/null",
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
226 false, "async"),
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
227 1);
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
228
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
229 retval = (tmp(0).double_value () == 0);
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
230 #endif
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
231
19774
904912f18357 make open_with_system_app a built-in function
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
232 return retval;
19271
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
233 }
030d56f67363 implement the open function
John W. Eaton <jwe@octave.org>
parents: 19270
diff changeset
234
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
235 #if defined (__MINGW32__)
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
236 static void
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
237 MINGW_init (void)
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
238 {
19302
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
239 w32_init ();
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
240 }
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
241 #endif
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
242
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
243 #if defined (_MSC_VER)
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
244 static void
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
245 MSVC_init (void)
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
246 {
19302
37159a873c96 preserve text on Windows terminal resize (bug #41893; patch #8532)
John W. Eaton <jwe@octave.org>
parents: 18674
diff changeset
247 w32_init ();
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
248 }
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
249 #endif
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
250
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
251 // Return TRUE if FILE1 and FILE2 refer to the same (physical) file.
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
252
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
253 bool
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
254 same_file_internal (const std::string& file1, const std::string& file2)
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
255 {
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21662
diff changeset
256 #if defined (OCTAVE_USE_WINDOWS_API)
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
257
6691
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
258 bool retval = false;
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
259
16564
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
260 const char *f1 = file1.c_str ();
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
261 const char *f2 = file2.c_str ();
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
262
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
263 bool f1_is_dir = GetFileAttributes (f1) & FILE_ATTRIBUTE_DIRECTORY;
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
264 bool f2_is_dir = GetFileAttributes (f2) & FILE_ATTRIBUTE_DIRECTORY;
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
265
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
266 // Windows native code
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
267 // Reference: http://msdn2.microsoft.com/en-us/library/aa363788.aspx
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
268
16564
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
269 DWORD share = FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE;
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
270
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
271 HANDLE hfile1
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
272 = CreateFile (f1, 0, share, 0, OPEN_EXISTING,
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
273 f1_is_dir ? FILE_FLAG_BACKUP_SEMANTICS : 0, 0);
6691
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
274
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
275 if (hfile1 != INVALID_HANDLE_VALUE)
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
276 {
16564
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
277 HANDLE hfile2
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
278 = CreateFile (f2, 0, share, 0, OPEN_EXISTING,
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
279 f2_is_dir ? FILE_FLAG_BACKUP_SEMANTICS : 0, 0);
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
280
6691
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
281 if (hfile2 != INVALID_HANDLE_VALUE)
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
282 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
283 BY_HANDLE_FILE_INFORMATION hfi1;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
284 BY_HANDLE_FILE_INFORMATION hfi2;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
285
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
286 if (GetFileInformationByHandle (hfile1, &hfi1)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
287 && GetFileInformationByHandle (hfile2, &hfi2))
16564
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
288 {
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
289 retval = (hfi1.dwVolumeSerialNumber == hfi2.dwVolumeSerialNumber
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
290 && hfi1.nFileIndexHigh == hfi2.nFileIndexHigh
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
291 && hfi1.nFileIndexLow == hfi2.nFileIndexLow);
aa5299a1d770 * sysdep.cc (same_file_internal): Handle directories on Windows systems.
John W. Eaton <jwe@octave.org>
parents: 16537
diff changeset
292 }
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
293
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
294 CloseHandle (hfile2);
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
295 }
6691
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
296
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
297 CloseHandle (hfile1);
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
298 }
6691
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
299
c6ee6c342699 [project @ 2007-06-05 05:50:10 by jwe]
jwe
parents: 6677
diff changeset
300 return retval;
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
301
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
302 #else
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
303
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
304 // POSIX Code
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
305
21736
0504351a45e6 use namespace for file_stat classes
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
306 octave::sys::file_stat fs_file1 (file1);
0504351a45e6 use namespace for file_stat classes
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
307 octave::sys::file_stat fs_file2 (file2);
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
308
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
309 return (fs_file1 && fs_file2
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
310 && fs_file1.ino () == fs_file2.ino ()
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
311 && fs_file1.dev () == fs_file2.dev ());
6598
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
312
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
313 #endif
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
314 }
ce819776ee76 [project @ 2007-04-27 17:34:27 by jwe]
jwe
parents: 6423
diff changeset
315
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
316 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
317 sysdep_init (void)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
318 {
21557
f6663c49870c Add comment clarifying why omp_get_num_threads is called in sysdep.cc.
Rik <rik@octave.org>
parents: 21556
diff changeset
319 // Use a function from libgomp to force loading of OpenMP library.
f6663c49870c Add comment clarifying why omp_get_num_threads is called in sysdep.cc.
Rik <rik@octave.org>
parents: 21556
diff changeset
320 // Otherwise, a dynamically loaded library making use of OpenMP such
f6663c49870c Add comment clarifying why omp_get_num_threads is called in sysdep.cc.
Rik <rik@octave.org>
parents: 21556
diff changeset
321 // as GraphicsMagick will segfault on exit (bug #41699).
21554
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
322 #if defined (HAVE_OMP_GET_NUM_THREADS)
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
323 omp_get_num_threads ();
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
324 #endif
9f0088f3f335 call openmp function at initialization (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20788
diff changeset
325
14861
f7afecdd87ef maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents: 14445
diff changeset
326 #if defined (__386BSD__) || defined (__FreeBSD__) || defined (__NetBSD__)
2508
f8d5dbbbc50a [project @ 1996-11-13 17:21:07 by jwe]
jwe
parents: 2493
diff changeset
327 BSD_init ();
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
328 #elif defined (__MINGW32__)
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
329 MINGW_init ();
6080
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
330 #elif defined (_MSC_VER)
40ab35ab651c [project @ 2006-10-25 03:26:36 by jwe]
jwe
parents: 5823
diff changeset
331 MSVC_init ();
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
332 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
333 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
334
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
335 void
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
336 sysdep_cleanup (void)
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
337 {
21989
6bce4d23af6b eliminate OCTAVE_USE_WINDOWS_API and OCTAVE_USE_OS_X_API from header files
John W. Eaton <jwe@octave.org>
parents: 21979
diff changeset
338 #if defined (OCTAVE_USE_WINDOWS_API)
6bce4d23af6b eliminate OCTAVE_USE_WINDOWS_API and OCTAVE_USE_OS_X_API from header files
John W. Eaton <jwe@octave.org>
parents: 21979
diff changeset
339 // Let us fail immediately without displaying any dialog.
6bce4d23af6b eliminate OCTAVE_USE_WINDOWS_API and OCTAVE_USE_OS_X_API from header files
John W. Eaton <jwe@octave.org>
parents: 21979
diff changeset
340 SetProcessShutdownParameters (0x280, SHUTDOWN_NORETRY);
6bce4d23af6b eliminate OCTAVE_USE_WINDOWS_API and OCTAVE_USE_OS_X_API from header files
John W. Eaton <jwe@octave.org>
parents: 21979
diff changeset
341 #endif
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
342 }
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5395
diff changeset
343
767
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
344 // Set terminal in raw mode. From less-177.
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
345 //
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
346 // Change terminal to "raw mode", or restore to "normal" mode.
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
347 // "Raw mode" means
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
348 // 1. An outstanding read will complete on receipt of a single keystroke.
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
349 // 2. Input is not echoed.
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
350 // 3. On output, \n is mapped to \r\n.
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
351 // 4. \t is NOT expanded into spaces.
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
352 // 5. Signal-causing characters such as ctrl-C (interrupt),
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
353 // etc. are NOT disabled.
767
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
354 // It doesn't matter whether an input \n is mapped to \r, or vice versa.
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
355
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
356 void
3657
a908150a3a32 [project @ 2000-04-11 19:02:03 by jwe]
jwe
parents: 3531
diff changeset
357 raw_mode (bool on, bool wait)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
358 {
3657
a908150a3a32 [project @ 2000-04-11 19:02:03 by jwe]
jwe
parents: 3531
diff changeset
359 static bool curr_on = false;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
360
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
361 int tty_fd = STDIN_FILENO;
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21888
diff changeset
362 if (! octave_isatty_wrapper (tty_fd))
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
363 {
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 22051
diff changeset
364 if (octave::application::interactive ()
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 22051
diff changeset
365 && ! octave::application::forced_interactive ())
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
366 error ("stdin is not a tty!");
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
367 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
368
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
369 if (on == curr_on)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
370 return;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
371
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
372 #if defined (HAVE_TERMIOS_H)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
373 {
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
374 struct termios s;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
375 static struct termios save_term;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
376
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
377 if (on)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
378 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
379 // Get terminal modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
380
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
381 tcgetattr (tty_fd, &s);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
382
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
383 // Save modes and set certain variables dependent on modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
384
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
385 save_term = s;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
386 // ospeed = s.c_cflag & CBAUD;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
387 // erase_char = s.c_cc[VERASE];
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
388 // kill_char = s.c_cc[VKILL];
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
389
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
390 // Set the modes to the way we want them.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
391
21662
5b9868c2e212 maint: Octave coding convention cleanups.
Rik <rik@octave.org>
parents: 21557
diff changeset
392 s.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL);
5b9868c2e212 maint: Octave coding convention cleanups.
Rik <rik@octave.org>
parents: 21557
diff changeset
393 s.c_oflag |= (OPOST | ONLCR);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
394 #if defined (OCRNL)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
395 s.c_oflag &= ~(OCRNL);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
396 #endif
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
397 #if defined (ONOCR)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
398 s.c_oflag &= ~(ONOCR);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
399 #endif
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
400 #if defined (ONLRET)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
401 s.c_oflag &= ~(ONLRET);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
402 #endif
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23325
diff changeset
403 s.c_cc[VMIN] = (wait ? 1 : 0);
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
404 s.c_cc[VTIME] = 0;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
405 }
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
406 else
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
407 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
408 // Restore saved modes.
1358
dc9c01f66a19 [project @ 1995-09-05 21:10:01 by jwe]
jwe
parents: 1352
diff changeset
409
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
410 s = save_term;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
411 }
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
412
9411
c9636d98e5cd fix kbhit(1) to not discard waiting keystrokes
Joe Rothweiler <octaveuser@sensicomm.com>
parents: 9242
diff changeset
413 tcsetattr (tty_fd, wait ? TCSAFLUSH : TCSADRAIN, &s);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
414 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
415 #elif defined (HAVE_TERMIO_H)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
416 {
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
417 struct termio s;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
418 static struct termio save_term;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
419
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
420 if (on)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
421 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
422 // Get terminal modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
423
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
424 ioctl (tty_fd, TCGETA, &s);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
425
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
426 // Save modes and set certain variables dependent on modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
427
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
428 save_term = s;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
429 // ospeed = s.c_cflag & CBAUD;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
430 // erase_char = s.c_cc[VERASE];
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
431 // kill_char = s.c_cc[VKILL];
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
432
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
433 // Set the modes to the way we want them.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
434
21662
5b9868c2e212 maint: Octave coding convention cleanups.
Rik <rik@octave.org>
parents: 21557
diff changeset
435 s.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL);
5b9868c2e212 maint: Octave coding convention cleanups.
Rik <rik@octave.org>
parents: 21557
diff changeset
436 s.c_oflag |= (OPOST | ONLCR);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
437 #if defined (OCRNL)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
438 s.c_oflag &= ~(OCRNL);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
439 #endif
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
440 #if defined (ONOCR)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
441 s.c_oflag &= ~(ONOCR);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
442 #endif
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
443 #if defined (ONLRET)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
444 s.c_oflag &= ~(ONLRET);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
445 #endif
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23325
diff changeset
446 s.c_cc[VMIN] = (wait ? 1 : 0);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
447 }
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
448 else
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
449 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
450 // Restore saved modes.
1358
dc9c01f66a19 [project @ 1995-09-05 21:10:01 by jwe]
jwe
parents: 1352
diff changeset
451
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
452 s = save_term;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
453 }
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
454
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
455 ioctl (tty_fd, TCSETAW, &s);
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
456 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
457 #elif defined (HAVE_SGTTY_H)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
458 {
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23812
diff changeset
459 octave_unused_parameter (wait);
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23812
diff changeset
460
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
461 struct sgttyb s;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
462 static struct sgttyb save_term;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
463
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
464 if (on)
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
465 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
466 // Get terminal modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
467
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
468 ioctl (tty_fd, TIOCGETP, &s);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
469
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
470 // Save modes and set certain variables dependent on modes.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
471
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
472 save_term = s;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
473 // ospeed = s.sg_ospeed;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
474 // erase_char = s.sg_erase;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
475 // kill_char = s.sg_kill;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
476
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
477 // Set the modes to the way we want them.
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
478
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
479 s.sg_flags |= CBREAK;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
480 s.sg_flags &= ~(ECHO);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
481 }
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
482 else
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
483 {
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
484 // Restore saved modes.
1358
dc9c01f66a19 [project @ 1995-09-05 21:10:01 by jwe]
jwe
parents: 1352
diff changeset
485
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
486 s = save_term;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
487 }
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
488
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
489 ioctl (tty_fd, TIOCSETN, &s);
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
490 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
491 #else
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23812
diff changeset
492
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23812
diff changeset
493 octave_unused_parameter (wait);
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23812
diff changeset
494
21109
bd1752782e56 Use err_disabled_feature, warn_disabled_feature throughout code base.
Rik <rik@octave.org>
parents: 21078
diff changeset
495 warn_disabled_feature ("", "raw mode console I/O");
4064
b4fa31442a78 [project @ 2002-09-26 21:10:45 by jwe]
jwe
parents: 3676
diff changeset
496
b4fa31442a78 [project @ 2002-09-26 21:10:45 by jwe]
jwe
parents: 3676
diff changeset
497 // Make sure the current mode doesn't toggle.
b4fa31442a78 [project @ 2002-09-26 21:10:45 by jwe]
jwe
parents: 3676
diff changeset
498 on = curr_on;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
499 #endif
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
500
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
501 curr_on = on;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
502 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
503
6726
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
504 FILE *
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
505 octave_popen (const char *command, const char *mode)
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
506 {
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
507 #if defined (__MINGW32__) || defined (_MSC_VER)
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
508 if (mode && mode[0] && ! mode[1])
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
509 {
22855
f9fdd2f66514 maint: use initializer of char array for octave_popen tmode.
Rik <rik@octave.org>
parents: 22755
diff changeset
510 // Use binary mode on Windows if unspecified
f9fdd2f66514 maint: use initializer of char array for octave_popen tmode.
Rik <rik@octave.org>
parents: 22755
diff changeset
511 char tmode[3] = {mode[0], 'b', '\0'};
6726
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
512
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
513 return _popen (command, tmode);
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
514 }
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
515 else
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
516 return _popen (command, mode);
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
517 #else
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
518 return popen (command, mode);
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
519 #endif
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
520 }
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
521
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
522 int
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
523 octave_pclose (FILE *f)
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
524 {
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
525 #if defined (__MINGW32__) || defined (_MSC_VER)
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
526 return _pclose (f);
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
527 #else
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
528 return pclose (f);
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
529 #endif
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
530 }
6b7ba4a31876 [project @ 2007-06-14 20:16:44 by jwe]
jwe
parents: 6691
diff changeset
531
767
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
532 // Read one character from the terminal.
42731861ee09 [project @ 1994-10-05 21:26:54 by jwe]
jwe
parents: 712
diff changeset
533
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
534 int
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
535 octave_kbhit (bool wait)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
536 {
20788
a2b96b523472 Rewrite a8ee668e7fd7 to use #if defined rather than #ifdef.
Rik <rik@octave.org>
parents: 20786
diff changeset
537 #if defined (HAVE__KBHIT) && defined (HAVE__GETCH)
20786
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
538 // This essentially means we are on a Windows system.
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
539 int c;
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
540
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
541 if (wait)
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
542 c = _getch ();
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
543 else
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
544 c = (! _kbhit ()) ? 0 : _getch ();
a8ee668e7fd7 Fix kbhit and pause on Windows systems.
Rik <rik@octave.org>
parents: 20181
diff changeset
545
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
546 #else
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
547 raw_mode (true, wait);
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
548
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
549 // Get current handler.
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22019
diff changeset
550 octave::interrupt_handler saved_interrupt_handler
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22019
diff changeset
551 = octave::ignore_interrupts ();
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
552
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
553 // Restore it, disabling system call restarts (if possible) so the
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
554 // read can be interrupted.
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
555
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22019
diff changeset
556 octave::set_interrupt_handler (saved_interrupt_handler, false);
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
557
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
558 int c = std::cin.get ();
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
559
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
560 if (std::cin.fail () || std::cin.eof ())
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
561 std::cin.clear ();
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
562
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
563 // Restore it, enabling system call restarts (if possible).
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22019
diff changeset
564 octave::set_interrupt_handler (saved_interrupt_handler, true);
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5455
diff changeset
565
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
566 raw_mode (false, true);
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
567 #endif
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
568
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
569 return c;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
570 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
571
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
572 std::string
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
573 get_P_tmpdir (void)
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
574 {
21979
d04da18a407a use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents: 21966
diff changeset
575 #if defined (OCTAVE_USE_WINDOWS_API)
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
576
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
577 std::string retval;
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
578
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
579 #if defined (P_tmpdir)
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
580 retval = P_tmpdir;
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
581 #endif
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
582
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
583 // Apparently some versions of MinGW and MSVC either don't define
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
584 // P_tmpdir, or they define it to a single backslash, neither of which
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
585 // is particularly helpful.
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
586
23809
e56d84a16a2e Fix "no match for 'operator=='" when comparing C++ string to char literal.
Markus Mützel <markus.muetzel@gmx.de>
parents: 23804
diff changeset
587 if (retval.empty () || retval == R"(\)")
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
588 {
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
589 retval = octave::sys::env::getenv ("TEMP");
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
590
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
591 if (retval.empty ())
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
592 retval = octave::sys::env::getenv ("TMP");
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
593
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
594 if (retval.empty ())
23804
8057d3f0673d Use C++11 raw string literals to avoid escaping backslashes in strings.
Rik <rik@octave.org>
parents: 23746
diff changeset
595 retval = R"(c:\temp)";
12228
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
596 }
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
597
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
598 return retval;
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
599
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
600 #elif defined (P_tmpdir)
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
601
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
602 return P_tmpdir;
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
603
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
604 #else
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
605
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
606 return "/tmp";
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
607
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
608 #endif
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
609 }
0f70c5db58c3 try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
610
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
611 DEFUN (clc, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
612 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
613 @deftypefn {} {} clc ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
614 @deftypefnx {} {} home ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
615 Clear the terminal screen and move the cursor to the upper left corner.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
616 @end deftypefn */)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
617 {
16537
106a38d7b396 optionall disable redisplay in command editor clear screen function
John W. Eaton <jwe@octave.org>
parents: 16404
diff changeset
618 bool skip_redisplay = true;
106a38d7b396 optionall disable redisplay in command editor clear screen function
John W. Eaton <jwe@octave.org>
parents: 16404
diff changeset
619
21748
176536b15d68 use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents: 21739
diff changeset
620 octave::command_editor::clear_screen (skip_redisplay);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
621
20941
a4f5da7c5463 maint: Replace "octave_value_list ()" with "ovl ()".
Rik <rik@octave.org>
parents: 20940
diff changeset
622 return ovl ();
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
623 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
624
549
75a371805554 [project @ 1994-07-22 19:44:41 by jwe]
jwe
parents: 545
diff changeset
625 DEFALIAS (home, clc);
75a371805554 [project @ 1994-07-22 19:44:41 by jwe]
jwe
parents: 545
diff changeset
626
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
627 DEFUN (getenv, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
628 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
629 @deftypefn {} {} getenv (@var{var})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
630 Return the value of the environment variable @var{var}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
631
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
632 For example,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
633
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
634 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
635 getenv ("PATH")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
636 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
637
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
638 @noindent
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
639 returns a string containing the value of your path.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
640 @seealso{setenv, unsetenv}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
641 @end deftypefn */)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
642 {
20819
f428cbe7576f eliminate unnecessary uses of nargin
John W. Eaton <jwe@octave.org>
parents: 20799
diff changeset
643 if (args.length () != 1)
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5775
diff changeset
644 print_usage ();
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
645
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
646 std::string name = args(0).string_value ();
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
647
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
648 return ovl (octave::sys::env::getenv (name));
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
649 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
650
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
651 /*
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
652 %!assert (ischar (getenv ("OCTAVE_HOME")))
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
653 */
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
654
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
655 DEFUN (setenv, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
656 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
657 @deftypefn {} {} setenv (@var{var}, @var{value})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
658 @deftypefnx {} {} setenv (@var{var})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
659 @deftypefnx {} {} putenv (@dots{})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
660 Set the value of the environment variable @var{var} to @var{value}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
661
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
662 If no @var{value} is specified then the variable will be assigned the null
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
663 string.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
664 @seealso{unsetenv, getenv}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
665 @end deftypefn */)
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
666 {
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
667 int nargin = args.length ();
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
668
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
669 if (nargin < 1 || nargin > 2)
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5775
diff changeset
670 print_usage ();
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
671
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
672 std::string var = args(0).xstring_value ("setenv: VAR must be a string");
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
673
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
674 std::string val = (nargin == 2
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
675 ? args(1).xstring_value ("setenv: VALUE must be a string")
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20990
diff changeset
676 : "");
20582
ba2b07c13913 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20555
diff changeset
677
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
678 octave::sys::env::putenv (var, val);
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
679
21078
49852ff04747 maint: Remove unnecessary declarations of retval.
Rik <rik@octave.org>
parents: 21017
diff changeset
680 return ovl ();
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
681 }
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
682
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
683 DEFALIAS (putenv, setenv);
1706
6bb0c67bbf24 [project @ 1996-01-07 05:40:05 by jwe]
jwe
parents: 1670
diff changeset
684
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
685 /*
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
686 %!test
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
687 %! setenv ("dummy_variable_that_cannot_matter", "foobar");
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
688 %! assert (getenv ("dummy_variable_that_cannot_matter"), "foobar");
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
689 %! unsetenv ("dummy_variable_that_cannot_matter");
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
690 %! assert (getenv ("dummy_variable_that_cannot_matter"), "");
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
691 */
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
692
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
693 DEFUN (unsetenv, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
694 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
695 @deftypefn {} {@var{status} =} unsetenv (@var{var})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
696 Delete the environment variable @var{var}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
697
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
698 Return 0 if the variable was deleted, or did not exist, and -1 if an error
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
699 occurred.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
700 @seealso{setenv, getenv}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
701 @end deftypefn */)
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
702 {
20819
f428cbe7576f eliminate unnecessary uses of nargin
John W. Eaton <jwe@octave.org>
parents: 20799
diff changeset
703 if (args.length () != 1)
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
704 print_usage ();
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
705
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
706 std::string tmp = args(0).string_value ();
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
707
21888
00f1249f2483 create wrappers for some gnulib functions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
708 return ovl (octave_unsetenv_wrapper (tmp.c_str ()));
19167
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
709 }
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
710
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
711 /*
6f0290863d50 Add new function unsetenv from gnulib to Octave.
Rik <rik@octave.org>
parents: 18674
diff changeset
712 ## Test for unsetenv is in setenv test
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
713 */
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
714
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
715 // FIXME: perhaps kbhit should also be able to print a prompt?
3372
f16c2ce14886 [project @ 1999-11-23 19:07:09 by jwe]
jwe
parents: 3333
diff changeset
716
3657
a908150a3a32 [project @ 2000-04-11 19:02:03 by jwe]
jwe
parents: 3531
diff changeset
717 DEFUN (kbhit, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
718 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
719 @deftypefn {} {} kbhit ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
720 @deftypefnx {} {} kbhit (1)
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
721 Read a single keystroke from the keyboard.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
722
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
723 If called with an argument, don't wait for a keypress.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
724
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
725 For example,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
726
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
727 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
728 x = kbhit ();
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
729 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
730
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
731 @noindent
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
732 will set @var{x} to the next character typed at the keyboard as soon as
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
733 it is typed.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
734
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
735 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
736 x = kbhit (1);
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
737 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
738
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
739 @noindent
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
740 is identical to the above example, but doesn't wait for a keypress,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
741 returning the empty string if no key is available.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
742 @seealso{input, pause}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
743 @end deftypefn */)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
744 {
22141
ed6104a78ebf kbhit: return an empty string if not running interactively (bug #48541)
Mike Miller <mtmiller@octave.org>
parents: 22097
diff changeset
745 octave_value retval = "";
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
746
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
747 // FIXME: add timeout and default value args?
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
748
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 22051
diff changeset
749 if (octave::application::interactive ())
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
750 {
15423
53d073233fa4 call more built-in functions directly
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
751 Fdrawnow ();
6423
a90b54016b12 [project @ 2007-03-21 13:15:03 by jwe]
jwe
parents: 6419
diff changeset
752
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
753 int c = octave_kbhit (args.length () == 0);
3657
a908150a3a32 [project @ 2000-04-11 19:02:03 by jwe]
jwe
parents: 3531
diff changeset
754
3658
808f399398c9 [project @ 2000-04-11 19:45:44 by jwe]
jwe
parents: 3657
diff changeset
755 if (c == -1)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
756 c = 0;
3657
a908150a3a32 [project @ 2000-04-11 19:02:03 by jwe]
jwe
parents: 3531
diff changeset
757
16092
def3b111cff8 avoid gcc warning about int to char conversion
John W. Eaton <jwe@octave.org>
parents: 16053
diff changeset
758 char s[2] = { static_cast<char> (c), '\0' };
16015
d910b9211cca Plug memory leak in kbhit().
Rik <rik@octave.org>
parents: 15423
diff changeset
759
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
760 retval = s;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
761 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
762
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
763 return retval;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
764 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
765
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
766 DEFUN (pause, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
767 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
768 @deftypefn {} {} pause ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
769 @deftypefnx {} {} pause (@var{n})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
770 Suspend the execution of the program for @var{n} seconds.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
771
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
772 If invoked without an input arguments then the program is suspended until a
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
773 character is typed.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
774
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
775 @var{n} is a positive real value and may be a fraction of a second,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
776 for example:
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
777
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
778 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
779 @group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
780 tic; pause (0.05); toc
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
781 @print{} Elapsed time is 0.05039 seconds.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
782 @end group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
783 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
784
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
785 The following example prints a message and then waits 5 seconds before
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
786 clearing the screen.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
787
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
788 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
789 @group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
790 disp ("wait please...");
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
791 pause (5);
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
792 clc;
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
793 @end group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
794 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
795
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
796 @seealso{kbhit}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
797 @end deftypefn */)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
798 {
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
799 int nargin = args.length ();
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
800
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
801 if (nargin > 1)
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
802 print_usage ();
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
803
1579
972ce8b5a757 [project @ 1995-10-19 06:39:35 by jwe]
jwe
parents: 1488
diff changeset
804 if (nargin == 1)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
805 {
1579
972ce8b5a757 [project @ 1995-10-19 06:39:35 by jwe]
jwe
parents: 1488
diff changeset
806 double dval = args(0).double_value ();
636
fae2bd91c027 [project @ 1994-08-23 18:39:50 by jwe]
jwe
parents: 610
diff changeset
807
21782
2aef506f3fec use namespace for lo-mappers.h functions
John W. Eaton <jwe@octave.org>
parents: 21748
diff changeset
808 if (octave::math::isnan (dval))
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20923
diff changeset
809 warning ("pause: NaN is an invalid delay");
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20923
diff changeset
810 else
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
811 {
20555
f90c8372b7ba eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20181
diff changeset
812 Fdrawnow ();
6419
73fcbac81f33 [project @ 2007-03-20 17:18:24 by jwe]
jwe
parents: 6208
diff changeset
813
21782
2aef506f3fec use namespace for lo-mappers.h functions
John W. Eaton <jwe@octave.org>
parents: 21748
diff changeset
814 if (octave::math::isinf (dval))
20555
f90c8372b7ba eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20181
diff changeset
815 {
23060
baf03cdb28b5 move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22855
diff changeset
816 octave::flush_stdout ();
20555
f90c8372b7ba eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20181
diff changeset
817 octave_kbhit ();
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
818 }
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
819 else
20555
f90c8372b7ba eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20181
diff changeset
820 octave_sleep (dval);
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10266
diff changeset
821 }
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 505
diff changeset
822 }
1579
972ce8b5a757 [project @ 1995-10-19 06:39:35 by jwe]
jwe
parents: 1488
diff changeset
823 else
3234
be8e0ba13644 [project @ 1999-01-29 03:52:30 by jwe]
jwe
parents: 3124
diff changeset
824 {
15423
53d073233fa4 call more built-in functions directly
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
825 Fdrawnow ();
23060
baf03cdb28b5 move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22855
diff changeset
826 octave::flush_stdout ();
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 4064
diff changeset
827 octave_kbhit ();
3234
be8e0ba13644 [project @ 1999-01-29 03:52:30 by jwe]
jwe
parents: 3124
diff changeset
828 }
2630
fdee6fe3e73b [project @ 1997-01-27 19:08:47 by jwe]
jwe
parents: 2610
diff changeset
829
20941
a4f5da7c5463 maint: Replace "octave_value_list ()" with "ovl ()".
Rik <rik@octave.org>
parents: 20940
diff changeset
830 return ovl ();
2630
fdee6fe3e73b [project @ 1997-01-27 19:08:47 by jwe]
jwe
parents: 2610
diff changeset
831 }
fdee6fe3e73b [project @ 1997-01-27 19:08:47 by jwe]
jwe
parents: 2610
diff changeset
832
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
833 /*
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
834 %!test
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
835 %! pause (1);
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14160
diff changeset
836
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14160
diff changeset
837 %!error (pause (1, 2))
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
838 */
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
839
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
840 // FIXME: maybe this should only return 1 if IEEE floating
862
61d83ce7368c [project @ 1994-10-31 20:39:30 by jwe]
jwe
parents: 844
diff changeset
841 // point functions really work.
61d83ce7368c [project @ 1994-10-31 20:39:30 by jwe]
jwe
parents: 844
diff changeset
842
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
843 DEFUN (isieee, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
844 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
845 @deftypefn {} {} isieee ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
846 Return true if your computer @emph{claims} to conform to the IEEE standard
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
847 for floating point calculations.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
848
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
849 No actual tests are performed.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
850 @end deftypefn */)
862
61d83ce7368c [project @ 1994-10-31 20:39:30 by jwe]
jwe
parents: 844
diff changeset
851 {
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
852 octave::mach_info::float_format flt_fmt =
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
853 octave::mach_info::native_float_format ();
2317
8c09c04f7747 [project @ 1996-07-14 22:30:15 by jwe]
jwe
parents: 2086
diff changeset
854
21739
c4ab2e54f100 use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents: 21736
diff changeset
855 return ovl (flt_fmt == octave::mach_info::flt_fmt_ieee_little_endian
c4ab2e54f100 use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents: 21736
diff changeset
856 || flt_fmt == octave::mach_info::flt_fmt_ieee_big_endian);
862
61d83ce7368c [project @ 1994-10-31 20:39:30 by jwe]
jwe
parents: 844
diff changeset
857 }
61d83ce7368c [project @ 1994-10-31 20:39:30 by jwe]
jwe
parents: 844
diff changeset
858
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
859 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14160
diff changeset
860 %!assert (islogical (isieee ()))
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
861 */
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
862
4600
3680bb30de0b [project @ 2003-11-12 18:25:53 by jwe]
jwe
parents: 4574
diff changeset
863 DEFUN (native_float_format, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
864 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
865 @deftypefn {} {} native_float_format ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
866 Return the native floating point format as a string.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
867 @end deftypefn */)
4600
3680bb30de0b [project @ 2003-11-12 18:25:53 by jwe]
jwe
parents: 4574
diff changeset
868 {
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
869 octave::mach_info::float_format flt_fmt =
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
870 octave::mach_info::native_float_format ();
4600
3680bb30de0b [project @ 2003-11-12 18:25:53 by jwe]
jwe
parents: 4574
diff changeset
871
21739
c4ab2e54f100 use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents: 21736
diff changeset
872 return ovl (octave::mach_info::float_format_as_string (flt_fmt));
4600
3680bb30de0b [project @ 2003-11-12 18:25:53 by jwe]
jwe
parents: 4574
diff changeset
873 }
3680bb30de0b [project @ 2003-11-12 18:25:53 by jwe]
jwe
parents: 4574
diff changeset
874
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
875 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14160
diff changeset
876 %!assert (ischar (native_float_format ()))
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
877 */
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
878
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
879 DEFUN (tilde_expand, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
880 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
881 @deftypefn {} {} tilde_expand (@var{string})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
882 @deftypefnx {} {} tilde_expand (@var{cellstr})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
883 Perform tilde expansion on @var{string}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
884
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
885 If @var{string} begins with a tilde character, (@samp{~}), all of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
886 characters preceding the first slash (or all characters, if there is no
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
887 slash) are treated as a possible user name, and the tilde and the following
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
888 characters up to the slash are replaced by the home directory of the named
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
889 user. If the tilde is followed immediately by a slash, the tilde is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
890 replaced by the home directory of the user running Octave.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
891
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
892 If the input is a cell array of strings @var{cellstr} then tilde expansion
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
893 is performed on each string element.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
894
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
895 Examples:
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
896
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
897 @example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
898 @group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
899 tilde_expand ("~joeuser/bin")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
900 @result{} "/home/joeuser/bin"
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
901 tilde_expand ("~/bin")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
902 @result{} "/home/jwe/bin"
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
903 @end group
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
904 @end example
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
905 @end deftypefn */)
1750
fd0d12493223 [project @ 1996-01-13 09:31:07 by jwe]
jwe
parents: 1742
diff changeset
906 {
20819
f428cbe7576f eliminate unnecessary uses of nargin
John W. Eaton <jwe@octave.org>
parents: 20799
diff changeset
907 if (args.length () != 1)
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5775
diff changeset
908 print_usage ();
1750
fd0d12493223 [project @ 1996-01-13 09:31:07 by jwe]
jwe
parents: 1742
diff changeset
909
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
910 octave_value arg = args(0);
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6086
diff changeset
911
20990
fc9cca99b2de Deprecate all_strings, replace with string_vector_value.
Rik <rik@octave.org>
parents: 20961
diff changeset
912 string_vector sv = arg.xstring_vector_value ("tilde_expand: argument must be char or cellstr object");
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6086
diff changeset
913
21733
cb0fdd941d84 use namespace for system file_ops class
John W. Eaton <jwe@octave.org>
parents: 21732
diff changeset
914 sv = octave::sys::file_ops::tilde_expand (sv);
20799
c349d4c91ce2 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20789
diff changeset
915
23575
e95738a119da maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents: 23459
diff changeset
916 if (arg.iscellstr ())
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20923
diff changeset
917 return ovl (Cell (arg.dims (), sv));
1750
fd0d12493223 [project @ 1996-01-13 09:31:07 by jwe]
jwe
parents: 1742
diff changeset
918 else
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20923
diff changeset
919 return ovl (sv);
1750
fd0d12493223 [project @ 1996-01-13 09:31:07 by jwe]
jwe
parents: 1742
diff changeset
920 }
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
921
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
922 /*
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
923 %!test
20016
47d420d769ba * sysdep.cc (Fget_home_directory): New function.
John W. Eaton <jwe@octave.org>
parents: 19861
diff changeset
924 %! home = get_home_directory ();
20064
ab7582167810 Fix failing BIST test for tilde_expand() on Windows (bug #44796).
Rik <rik@octave.org>
parents: 20024
diff changeset
925 %! assert (tilde_expand ("~/foobar"), [home "/foobar"]);
12825
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
926 %! assert (tilde_expand ("/foo/bar"), "/foo/bar");
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
927 %! assert (tilde_expand ("foo/bar"), "foo/bar");
a1dcb854a4f9 codesprint: new tests for sysdep.cc functions
John W. Eaton <jwe@octave.org>
parents: 12483
diff changeset
928 */
17851
af685269e06c avoid symbol conflicts in display.cc
John W. Eaton <jwe@octave.org>
parents: 17787
diff changeset
929
20016
47d420d769ba * sysdep.cc (Fget_home_directory): New function.
John W. Eaton <jwe@octave.org>
parents: 19861
diff changeset
930 DEFUN (get_home_directory, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
931 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
932 @deftypefn {} {@var{homedir} =} get_home_directory ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
933 Return the current home directory.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
934
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
935 On most systems, this is equivalent to @code{getenv ("HOME")}. On Windows
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
936 systems, if the environment variable @env{HOME} is not set then it is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
937 equivalent to
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
938 @code{fullfile (getenv ("HOMEDRIVE"), getenv ("HOMEPATH"))}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
939 @seealso{getenv}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
940 @end deftypefn */)
20016
47d420d769ba * sysdep.cc (Fget_home_directory): New function.
John W. Eaton <jwe@octave.org>
parents: 19861
diff changeset
941 {
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
942 return ovl (octave::sys::env::get_home_directory ());
20016
47d420d769ba * sysdep.cc (Fget_home_directory): New function.
John W. Eaton <jwe@octave.org>
parents: 19861
diff changeset
943 }
47d420d769ba * sysdep.cc (Fget_home_directory): New function.
John W. Eaton <jwe@octave.org>
parents: 19861
diff changeset
944
20024
cf9b94a89620 Document get_home_directory in Octave manual and NEWS file.
Rik <rik@octave.org>
parents: 20016
diff changeset
945 /*
cf9b94a89620 Document get_home_directory in Octave manual and NEWS file.
Rik <rik@octave.org>
parents: 20016
diff changeset
946 %!test
cf9b94a89620 Document get_home_directory in Octave manual and NEWS file.
Rik <rik@octave.org>
parents: 20016
diff changeset
947 %! if (! ispc ())
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20172
diff changeset
948 %! assert (get_home_directory (), getenv ("HOME"));
20024
cf9b94a89620 Document get_home_directory in Octave manual and NEWS file.
Rik <rik@octave.org>
parents: 20016
diff changeset
949 %! endif
cf9b94a89620 Document get_home_directory in Octave manual and NEWS file.
Rik <rik@octave.org>
parents: 20016
diff changeset
950 */