diff libinterp/corefcn/syscalls.cc @ 29961:7d6709900da7

eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more Files affected: __betainc__.cc, __contourc__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc, __ichol__.cc, __ilu__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, balance.cc, besselj.cc, bsxfun.cc, call-stack.cc, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, defaults.cc, dirfns.cc, display.cc, dlmread.cc, dmperm.cc, dot.cc, eig.cc, ellipj.cc, environment.cc, error.cc, event-manager.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, find.cc, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc, gsvd.cc, hash.cc, help.cc, hess.cc, hex2num.cc, input.cc, inv.cc, jsondecode.cc, jsonencode.cc, load-path.cc, load-save.cc, lookup.cc, lsode.cc, lu.cc, max.cc, mgorth.cc, oct-hist.cc, ordqz.cc, ordschur.cc, pager.cc, pr-output.cc, psi.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, regexp.cc, schur.cc, settings.cc, sighandlers.cc, sparse.cc, spparms.cc, sqrtm.cc, stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, symbfact.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc, tril.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc, __delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc, audioread.cc, convhulln.cc, fftw.cc, gzip.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, octave.cc, lex.ll, oct-parse.yy, profiler.cc, andpt-eval.cc.
author John W. Eaton <jwe@octave.org>
date Sat, 14 Aug 2021 22:48:52 -0400
parents 32c3a5805893
children 3988112c7116
line wrap: on
line diff
--- a/libinterp/corefcn/syscalls.cc	Sat Aug 14 21:50:26 2021 -0400
+++ b/libinterp/corefcn/syscalls.cc	Sat Aug 14 22:48:52 2021 -0400
@@ -63,16 +63,16 @@
 OCTAVE_NAMESPACE_BEGIN
 
 static octave_scalar_map
-mk_stat_map (const octave::sys::base_file_stat& fs)
+mk_stat_map (const sys::base_file_stat& fs)
 {
   static bool have_rdev
-    = octave::sys::base_file_stat::have_struct_stat_st_rdev ();
+    = sys::base_file_stat::have_struct_stat_st_rdev ();
   static bool have_blksize
-    = octave::sys::base_file_stat::have_struct_stat_st_blksize ();
+    = sys::base_file_stat::have_struct_stat_st_blksize ();
   static bool have_blocks
-    = octave::sys::base_file_stat::have_struct_stat_st_blocks ();
+    = sys::base_file_stat::have_struct_stat_st_blocks ();
 
-  static double nan = octave::numeric_limits<double>::NaN ();
+  static double nan = numeric_limits<double>::NaN ();
 
   octave_scalar_map m;
 
@@ -103,7 +103,7 @@
 }
 
 static octave_value_list
-mk_stat_result (const octave::sys::base_file_stat& fs)
+mk_stat_result (const sys::base_file_stat& fs)
 {
   if (fs)
     return ovl (octave_value (mk_stat_map (fs)), 0, "");
@@ -125,11 +125,11 @@
   if (args.length () != 2)
     print_usage ();
 
-  octave::stream_list& streams = interp.get_stream_list ();
+  stream_list& streams = interp.get_stream_list ();
 
-  octave::stream old_stream = streams.lookup (args(0), "dup2");
+  stream old_stream = streams.lookup (args(0), "dup2");
 
-  octave::stream new_stream = streams.lookup (args(1), "dup2");
+  stream new_stream = streams.lookup (args(1), "dup2");
 
   int i_old = old_stream.file_number ();
   int i_new = new_stream.file_number ();
@@ -138,7 +138,7 @@
     {
       std::string msg;
 
-      int status = octave::sys::dup2 (i_old, i_new, msg);
+      int status = sys::dup2 (i_old, i_new, msg);
 
       return ovl (status, msg);
     }
@@ -196,16 +196,16 @@
       exec_args[0] = exec_file;
     }
 
-  octave::history_system& history_sys = interp.get_history_system ();
+  history_system& history_sys = interp.get_history_system ();
 
   history_sys.write_timestamp ();
 
-  if (! octave::command_history::ignoring_entries ())
-    octave::command_history::clean_up_and_save ();
+  if (! command_history::ignoring_entries ())
+    command_history::clean_up_and_save ();
 
   std::string msg;
 
-  int status = octave::sys::execvp (exec_file, exec_args, msg);
+  int status = sys::execvp (exec_file, exec_args, msg);
 
   return ovl (status, msg);
 }
@@ -292,7 +292,7 @@
   std::string msg;
   pid_t pid;
 
-  pid = octave::sys::popen2 (exec_file, arg_list, sync_mode, filedesc, msg);
+  pid = sys::popen2 (exec_file, arg_list, sync_mode, filedesc, msg);
 
   if (pid < 0)
     error ("%s", msg.c_str ());
@@ -300,13 +300,13 @@
   FILE *ifile = fdopen (filedesc[1], "r");
   FILE *ofile = fdopen (filedesc[0], "w");
 
-  octave::stream is
+  stream is
     = octave_stdiostream::create (exec_file + "-in", ifile, std::ios::in);
 
-  octave::stream os
+  stream os
     = octave_stdiostream::create (exec_file + "-out", ofile, std::ios::out);
 
-  octave::stream_list& streams = interp.get_stream_list ();
+  stream_list& streams = interp.get_stream_list ();
 
   return ovl (streams.insert (os), streams.insert (is), pid);
 }
@@ -442,9 +442,9 @@
   if (args.length () != 3)
     print_usage ();
 
-  octave::stream_list& streams = interp.get_stream_list ();
+  stream_list& streams = interp.get_stream_list ();
 
-  octave::stream strm = streams.lookup (args(0), "fcntl");
+  stream strm = streams.lookup (args(0), "fcntl");
 
   int fid = strm.file_number ();
 
@@ -460,7 +460,7 @@
   octave_value_list retval;
   std::string msg;
 
-  int status = octave::sys::fcntl (fid, req, arg, msg);
+  int status = sys::fcntl (fid, req, arg, msg);
 
   if (nargout == 0)
     {
@@ -509,7 +509,7 @@
 
   std::string msg;
 
-  pid_t pid = octave::sys::fork (msg);
+  pid_t pid = sys::fork (msg);
 
   return ovl (pid, msg);
 }
@@ -525,7 +525,7 @@
 
   std::string msg;
 
-  pid_t pid = octave::sys::getpgrp (msg);
+  pid_t pid = sys::getpgrp (msg);
 
   return ovl (pid, msg);
 }
@@ -540,7 +540,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::getpid ());
+  return ovl (sys::getpid ());
 }
 
 DEFUNX ("getppid", Fgetppid, args, ,
@@ -553,7 +553,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::getppid ());
+  return ovl (sys::getppid ());
 }
 
 DEFUNX ("getegid", Fgetegid, args, ,
@@ -566,7 +566,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::getegid ());
+  return ovl (sys::getegid ());
 }
 
 DEFUNX ("getgid", Fgetgid, args, ,
@@ -579,7 +579,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::getgid ());
+  return ovl (sys::getgid ());
 }
 
 DEFUNX ("geteuid", Fgeteuid, args, ,
@@ -592,7 +592,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::geteuid ());
+  return ovl (sys::geteuid ());
 }
 
 DEFUNX ("getuid", Fgetuid, args, ,
@@ -605,7 +605,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::getuid ());
+  return ovl (sys::getuid ());
 }
 
 DEFUNX ("kill", Fkill, args, nargout,
@@ -643,7 +643,7 @@
   octave_value_list retval;
   std::string msg;
 
-  int status = octave::sys::kill (pid, sig, msg);
+  int status = sys::kill (pid, sig, msg);
 
   if (nargout == 0)
     {
@@ -677,7 +677,7 @@
 
   std::string fname = args(0).xstring_value ("lstat: NAME must be a string");
 
-  octave::sys::file_stat fs (fname, false);
+  sys::file_stat fs (fname, false);
 
   return mk_stat_result (fs);
 }
@@ -740,7 +740,7 @@
   octave_value_list retval;
   std::string msg;
 
-  int status = octave::sys::mkfifo (name, mode, msg);
+  int status = sys::mkfifo (name, mode, msg);
 
   if (nargout == 0)
     {
@@ -789,7 +789,7 @@
   int fid[2];
   std::string msg;
 
-  int status = octave::sys::pipe (fid, msg);
+  int status = sys::pipe (fid, msg);
 
   if (status < 0)
     return ovl (-1, -1, -1, msg);
@@ -798,13 +798,13 @@
       FILE *ifile = fdopen (fid[0], "r");
       FILE *ofile = fdopen (fid[1], "w");
 
-      octave::stream is
+      stream is
         = octave_stdiostream::create ("pipe-in", ifile, std::ios::in);
 
-      octave::stream os
+      stream os
         = octave_stdiostream::create ("pipe-out", ofile, std::ios::out);
 
-      octave::stream_list& streams = interp.get_stream_list ();
+      stream_list& streams = interp.get_stream_list ();
 
       return ovl (streams.insert (is), streams.insert (os), status, msg);
     }
@@ -913,11 +913,11 @@
 
   if (args(0).is_scalar_type ())
     {
-      octave::stream_list& streams = interp.get_stream_list ();
+      stream_list& streams = interp.get_stream_list ();
 
       int fid = streams.get_file_number (args(0));
 
-      octave::sys::file_fstat fs (fid);
+      sys::file_fstat fs (fid);
 
       retval = mk_stat_result (fs);
     }
@@ -925,7 +925,7 @@
     {
       std::string fname = args(0).xstring_value ("stat: NAME must be a string");
 
-      octave::sys::file_stat fs (fname);
+      sys::file_stat fs (fname);
 
       retval = mk_stat_result (fs);
     }
@@ -948,7 +948,7 @@
 
   double mode = args(0).xdouble_value ("S_ISREG: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_reg (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_reg (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISDIR", FS_ISDIR, args, ,
@@ -966,7 +966,7 @@
 
   double mode = args(0).xdouble_value ("S_ISDIR: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_dir (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_dir (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISCHR", FS_ISCHR, args, ,
@@ -984,7 +984,7 @@
 
   double mode = args(0).xdouble_value ("S_ISCHR: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_chr (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_chr (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISBLK", FS_ISBLK, args, ,
@@ -1002,7 +1002,7 @@
 
   double mode = args(0).xdouble_value ("S_ISBLK: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_blk (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_blk (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISFIFO", FS_ISFIFO, args, ,
@@ -1020,7 +1020,7 @@
 
   double mode = args(0).xdouble_value ("S_ISFIFO: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_fifo (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_fifo (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISLNK", FS_ISLNK, args, ,
@@ -1038,7 +1038,7 @@
 
   double mode = args(0).xdouble_value ("S_ISLNK: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_lnk (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_lnk (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISSOCK", FS_ISSOCK, args, ,
@@ -1056,7 +1056,7 @@
 
   double mode = args(0).xdouble_value ("S_ISSOCK: invalid MODE value");
 
-  return ovl (octave::sys::file_stat::is_sock (static_cast<mode_t> (mode)));
+  return ovl (sys::file_stat::is_sock (static_cast<mode_t> (mode)));
 }
 
 DEFUN (gethostname, args, ,
@@ -1068,7 +1068,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return ovl (octave::sys::env::get_host_name ());
+  return ovl (sys::env::get_host_name ());
 }
 
 DEFUN (uname, args, ,
@@ -1099,7 +1099,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  octave::sys::uname sysinfo;
+  sys::uname sysinfo;
 
   octave_scalar_map m;
 
@@ -1141,11 +1141,11 @@
   octave_value_list retval;
   std::string msg;
 
-  octave::event_manager& evmgr = interp.get_event_manager ();
+  event_manager& evmgr = interp.get_event_manager ();
 
   evmgr.file_remove (name, "");
 
-  int status = octave::sys::unlink (name, msg);
+  int status = sys::unlink (name, msg);
 
   evmgr.file_renamed (status == 0);
 
@@ -1246,7 +1246,7 @@
   std::string msg;
   int status;
 
-  pid_t result = octave::sys::waitpid (pid, &status, options, msg);
+  pid_t result = sys::waitpid (pid, &status, options, msg);
 
   return ovl (result, status, msg);
 }
@@ -1264,7 +1264,7 @@
 
   int status = args(0).xint_value ("WIFEXITED: STATUS must be an integer");
 
-  return ovl (octave::sys::wifexited (status));
+  return ovl (sys::wifexited (status));
 }
 
 DEFUNX ("WEXITSTATUS", FWEXITSTATUS, args, ,
@@ -1282,7 +1282,7 @@
 
   int status = args(0).xint_value ("WEXITSTATUS: STATUS must be an integer");
 
-  return ovl (octave::sys::wexitstatus (status));
+  return ovl (sys::wexitstatus (status));
 }
 
 DEFUNX ("WIFSIGNALED", FWIFSIGNALED, args, ,
@@ -1298,7 +1298,7 @@
 
   int status = args(0).xint_value ("WIFSIGNALED: STATUS must be an integer");
 
-  return ovl (octave::sys::wifsignaled (status));
+  return ovl (sys::wifsignaled (status));
 }
 
 DEFUNX ("WTERMSIG", FWTERMSIG, args, ,
@@ -1316,7 +1316,7 @@
 
   int status = args(0).xint_value ("WTERMSIG: STATUS must be an integer");
 
-  return ovl (octave::sys::wtermsig (status));
+  return ovl (sys::wtermsig (status));
 }
 
 DEFUNX ("WCOREDUMP", FWCOREDUMP, args, ,
@@ -1336,7 +1336,7 @@
 
   int status = args(0).xint_value ("WCOREDUMP: STATUS must be an integer");
 
-  return ovl (octave::sys::wcoredump (status));
+  return ovl (sys::wcoredump (status));
 }
 
 DEFUNX ("WIFSTOPPED", FWIFSTOPPED, args, ,
@@ -1355,7 +1355,7 @@
 
   int status = args(0).xint_value ("WIFSTOPPED: STATUS must be an integer");
 
-  return ovl (octave::sys::wifstopped (status));
+  return ovl (sys::wifstopped (status));
 }
 
 DEFUNX ("WSTOPSIG", FWSTOPSIG, args, ,
@@ -1373,7 +1373,7 @@
 
   int status = args(0).xint_value ("WSTOPSIG: STATUS must be an integer");
 
-  return ovl (octave::sys::wstopsig (status));
+  return ovl (sys::wstopsig (status));
 }
 
 DEFUNX ("WIFCONTINUED", FWIFCONTINUED, args, ,
@@ -1389,7 +1389,7 @@
 
   int status = args(0).xint_value ("WIFCONTINUED: STATUS must be an integer");
 
-  return ovl (octave::sys::wifcontinued (status));
+  return ovl (sys::wifcontinued (status));
 }
 
 DEFUNX ("canonicalize_file_name", Fcanonicalize_file_name, args, ,
@@ -1409,7 +1409,7 @@
 
   std::string msg;
 
-  std::string result = octave::sys::canonicalize_file_name (name, msg);
+  std::string result = sys::canonicalize_file_name (name, msg);
 
   return ovl (result, msg.empty () ? 0 : -1, msg);
 }
@@ -1699,7 +1699,7 @@
 @seealso{waitpid, WUNTRACED, WCONTINUE}
 @end deftypefn */)
 {
-  return const_value (args, octave::sys::wnohang ());
+  return const_value (args, sys::wnohang ());
 }
 
 DEFUNX ("WUNTRACED", FWUNTRACED, args, ,
@@ -1713,7 +1713,7 @@
 @seealso{waitpid, WNOHANG, WCONTINUE}
 @end deftypefn */)
 {
-  return const_value (args, octave::sys::wuntraced ());
+  return const_value (args, sys::wuntraced ());
 }
 
 DEFUNX ("WCONTINUE", FWCONTINUE, args, ,
@@ -1727,7 +1727,7 @@
 @seealso{waitpid, WNOHANG, WUNTRACED}
 @end deftypefn */)
 {
-  return const_value (args, octave::sys::wcontinue ());
+  return const_value (args, sys::wcontinue ());
 }
 
 OCTAVE_NAMESPACE_END