diff libinterp/corefcn/sysdep.h @ 25649:85c3e315bd43

move libinterp/corefcn/sysdep functions inside octave namespace * libinterp/corefcn/sysdep.cc, changed libinterp/corefcn/sysdep.h: Move functions inside octave namespace. Change all uses.
author John W. Eaton <jwe@octave.org>
date Fri, 20 Jul 2018 09:01:15 -0400
parents 6652d3823428
children 00f796120a6d
line wrap: on
line diff
--- a/libinterp/corefcn/sysdep.h	Fri Jul 20 08:25:47 2018 -0400
+++ b/libinterp/corefcn/sysdep.h	Fri Jul 20 09:01:15 2018 -0400
@@ -32,24 +32,93 @@
 #include "lo-ieee.h"
 #include "lo-sysdep.h"
 
-extern OCTINTERP_API void sysdep_init (void);
+namespace octave
+{
+  extern OCTINTERP_API void sysdep_init (void);
+
+  extern OCTINTERP_API void set_application_id (void);
+
+  extern OCTINTERP_API void sysdep_cleanup (void);
 
-extern OCTINTERP_API void set_application_id (void);
+  extern OCTINTERP_API void raw_mode (bool, bool wait = true);
+
+  extern OCTINTERP_API FILE * popen (const char *command, const char *mode);
+
+  extern OCTINTERP_API int pclose (FILE *f);
+
+  extern OCTINTERP_API int kbhit (bool wait = true);
+
+  extern OCTINTERP_API std::string get_P_tmpdir (void);
 
-extern OCTINTERP_API void sysdep_cleanup (void);
+  extern OCTINTERP_API bool same_file_internal (const std::string&,
+                                                const std::string&);
+}
+
+#if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
 
-extern OCTINTERP_API void raw_mode (bool, bool wait = true);
+OCTAVE_DEPRECATED (5, "use 'octave::sysdep_init' instead")
+inline void
+sysdep_init (void)
+{
+  octave::sysdep_init ();
+}
+
+OCTAVE_DEPRECATED (5, "use 'octave::set_application_id' instead")
+inline void
+set_application_id (void)
+{
+  octave::set_application_id ();
+}
 
-extern OCTINTERP_API FILE * octave_popen (const char *command,
-                                          const char *mode);
+OCTAVE_DEPRECATED (5, "use 'octave::sysdep_cleanup' instead")
+inline void
+sysdep_cleanup (void)
+{
+  octave::sysdep_cleanup ();
+}
 
-extern OCTINTERP_API int octave_pclose (FILE *f);
+OCTAVE_DEPRECATED (5, "use 'octave::raw_mode' instead")
+inline void
+raw_mode (bool on, bool wait = true)
+{
+  octave::raw_mode (on, wait);
+}
+
+OCTAVE_DEPRECATED (5, "use 'octave::popen' instead")
+inline FILE *
+octave_popen (const char *command, const char *mode)
+{
+  return octave::popen (command, mode);
+}
 
-extern OCTINTERP_API int octave_kbhit (bool wait = true);
+OCTAVE_DEPRECATED (5, "use 'octave::pclose' instead")
+inline int
+octave_pclose (FILE *f)
+{
+  return octave::pclose (f);
+}
+
+OCTAVE_DEPRECATED (5, "use 'octave::kbhit' instead")
+inline int
+octave_kbhit (bool wait = true)
+{
+  return octave::kbhit (wait);
+}
 
-extern OCTINTERP_API std::string get_P_tmpdir (void);
+OCTAVE_DEPRECATED (5, "use 'octave::get_P_tmpdir' instead")
+inline std::string
+get_P_tmpdir (void)
+{
+  return octave::get_P_tmpdir ();
+}
 
-extern OCTINTERP_API bool same_file_internal (const std::string&,
-                                              const std::string&);
+OCTAVE_DEPRECATED (5, "use 'octave::same_file_internal' instead")
+inline bool
+same_file_internal (const std::string& a, const std::string& b)
+{
+  return octave::same_file_internal (a, b);
+}
 
 #endif
+
+#endif