From 2f4fc005937e75d931eb6ef87a3fe16364d45113 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 26 Jun 2014 21:59:27 -0700 Subject: Stick everything in a namespace --- src/io/cxxstdio.cpp | 5 +++++ src/io/cxxstdio.hpp | 3 +++ src/io/fd.cpp | 4 ++++ src/io/fd.hpp | 3 +++ src/io/fwd.hpp | 3 +++ src/io/line.cpp | 3 +++ src/io/line.hpp | 3 +++ src/io/line_test.cpp | 3 +++ src/io/lock.cpp | 3 +++ src/io/lock.hpp | 3 +++ src/io/read.cpp | 3 +++ src/io/read.hpp | 3 +++ src/io/read_test.cpp | 3 +++ src/io/tty.cpp | 4 ++++ src/io/tty.hpp | 3 +++ src/io/write.cpp | 3 +++ src/io/write.hpp | 4 ++++ src/io/write_test.cpp | 3 +++ 18 files changed, 59 insertions(+) (limited to 'src/io') diff --git a/src/io/cxxstdio.cpp b/src/io/cxxstdio.cpp index 8b18701..ca4e880 100644 --- a/src/io/cxxstdio.cpp +++ b/src/io/cxxstdio.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/io/cxxstdio.hpp b/src/io/cxxstdio.hpp index fc5829f..6e49c11 100644 --- a/src/io/cxxstdio.hpp +++ b/src/io/cxxstdio.hpp @@ -29,6 +29,8 @@ # include "../generic/enum.hpp" +namespace tmwa +{ namespace cxxstdio { // other implementations of do_vprint are injected by ADL. @@ -187,5 +189,6 @@ namespace cxxstdio }) } // namespace cxxstdio +} // namespace tmwa #endif // TMWA_IO_CXXSTDIO_HPP diff --git a/src/io/fd.cpp b/src/io/fd.cpp index 4fc33e9..4c61a6f 100644 --- a/src/io/fd.cpp +++ b/src/io/fd.cpp @@ -25,6 +25,9 @@ #include "../poison.hpp" + +namespace tmwa +{ namespace io { FD FD::open(ZString path, int flags, int mode) @@ -163,3 +166,4 @@ namespace io timeout, sigmask); } } // namespace io +} // namespace tmwa diff --git a/src/io/fd.hpp b/src/io/fd.hpp index a7460a8..9ea4d41 100644 --- a/src/io/fd.hpp +++ b/src/io/fd.hpp @@ -27,6 +27,8 @@ # include "../strings/fwd.hpp" +namespace tmwa +{ namespace io { class FD @@ -162,5 +164,6 @@ namespace io int pselect(int nfds, FD_Set *readfds, FD_Set *writefds, FD_Set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask); }; } // namespace io +} // namespace tmwa #endif // TMWA_IO_FD_HPP diff --git a/src/io/fwd.hpp b/src/io/fwd.hpp index 1e5fa82..2032c3b 100644 --- a/src/io/fwd.hpp +++ b/src/io/fwd.hpp @@ -22,11 +22,14 @@ # include "../sanity.hpp" +namespace tmwa +{ namespace io { class ReadFile; class WriteFile; class AppendFile; } // namespace io +} // namespace tmwa #endif // TMWA_IO_FWD_HPP diff --git a/src/io/line.cpp b/src/io/line.cpp index 4df29c8..a1cdf42 100644 --- a/src/io/line.cpp +++ b/src/io/line.cpp @@ -28,6 +28,8 @@ #include "../poison.hpp" +namespace tmwa +{ namespace io { AString Line::message_str(ZString cat, ZString msg) const @@ -178,3 +180,4 @@ namespace io return line != 0; } } // namespace io +} // namespace tmwa diff --git a/src/io/line.hpp b/src/io/line.hpp index 510a8f5..f481505 100644 --- a/src/io/line.hpp +++ b/src/io/line.hpp @@ -28,6 +28,8 @@ # include "read.hpp" +namespace tmwa +{ namespace io { // TODO split this out @@ -103,5 +105,6 @@ namespace io bool is_open(); }; } // namespace io +} // namespace tmwa #endif // TMWA_IO_LINE_HPP diff --git a/src/io/line_test.cpp b/src/io/line_test.cpp index d6efa67..9f04bf8 100644 --- a/src/io/line_test.cpp +++ b/src/io/line_test.cpp @@ -26,6 +26,8 @@ #include "../poison.hpp" +namespace tmwa +{ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" static @@ -420,3 +422,4 @@ TEST(io, linespan) "~~~\n"_s ); } +} // namespace tmwa diff --git a/src/io/lock.cpp b/src/io/lock.cpp index e06c2f1..7b8f014 100644 --- a/src/io/lock.cpp +++ b/src/io/lock.cpp @@ -35,6 +35,8 @@ #include "../poison.hpp" +namespace tmwa +{ /// number of backups to keep static const int backup_count = 10; @@ -91,3 +93,4 @@ namespace io rename(tmpfile.c_str(), filename.c_str()); } } // namespace io +} // namespace tmwa diff --git a/src/io/lock.hpp b/src/io/lock.hpp index ec8a82e..e4ec153 100644 --- a/src/io/lock.hpp +++ b/src/io/lock.hpp @@ -26,6 +26,8 @@ # include "../strings/rstring.hpp" +namespace tmwa +{ namespace io { class WriteLock : public WriteFile @@ -38,5 +40,6 @@ namespace io bool close() = delete; }; } // namespace io +} // namespace tmwa #endif // TMWA_IO_LOCK_HPP diff --git a/src/io/read.cpp b/src/io/read.cpp index 803d486..d3e2a19 100644 --- a/src/io/read.cpp +++ b/src/io/read.cpp @@ -30,6 +30,8 @@ #include "../poison.hpp" +namespace tmwa +{ namespace io { ReadFile::ReadFile(FD f) @@ -120,3 +122,4 @@ namespace io return fd != FD(); } } // namespace io +} // namespace tmwa diff --git a/src/io/read.hpp b/src/io/read.hpp index 3816294..6757496 100644 --- a/src/io/read.hpp +++ b/src/io/read.hpp @@ -25,6 +25,8 @@ # include "fd.hpp" +namespace tmwa +{ namespace io { class ReadFile @@ -49,5 +51,6 @@ namespace io bool is_open(); }; } // namespace io +} // namespace tmwa #endif // TMWA_IO_READ_HPP diff --git a/src/io/read_test.cpp b/src/io/read_test.cpp index 8cf7d7a..6fc1563 100644 --- a/src/io/read_test.cpp +++ b/src/io/read_test.cpp @@ -27,6 +27,8 @@ #include "../poison.hpp" +namespace tmwa +{ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" static @@ -87,3 +89,4 @@ TEST(io, read5) EXPECT_FALSE(hi); EXPECT_FALSE(rf.getline(hi)); } +} // namespace tmwa diff --git a/src/io/tty.cpp b/src/io/tty.cpp index e71ee44..c498740 100644 --- a/src/io/tty.cpp +++ b/src/io/tty.cpp @@ -20,4 +20,8 @@ #include "../poison.hpp" + +namespace tmwa +{ /* Nothing to see here, move along */ +} // namespace tmwa diff --git a/src/io/tty.hpp b/src/io/tty.hpp index b6eb227..86dc6d5 100644 --- a/src/io/tty.hpp +++ b/src/io/tty.hpp @@ -22,6 +22,8 @@ # include "fwd.hpp" +namespace tmwa +{ # define SGR_BLACK "\e[30m" # define SGR_RED "\e[31m" # define SGR_GREEN "\e[32m" @@ -34,5 +36,6 @@ # define SGR_BOLD "\e[1m" # define SGR_RESET "\e[0m" +} // namespace tmwa #endif // TMWA_IO_TTY_HPP diff --git a/src/io/write.cpp b/src/io/write.cpp index 18c4f9d..3326d2c 100644 --- a/src/io/write.cpp +++ b/src/io/write.cpp @@ -31,6 +31,8 @@ #include "../poison.hpp" +namespace tmwa +{ namespace io { WriteFile::WriteFile(FD f, bool linebuffered) @@ -177,3 +179,4 @@ namespace io return len; } } // namespace io +} // namespace tmwa diff --git a/src/io/write.hpp b/src/io/write.hpp index 1d67494..7e57841 100644 --- a/src/io/write.hpp +++ b/src/io/write.hpp @@ -27,6 +27,9 @@ # include "fd.hpp" + +namespace tmwa +{ namespace io { class WriteFile @@ -64,5 +67,6 @@ namespace io __attribute__((format(printf, 2, 0))) int do_vprint(WriteFile& out, const char *fmt, va_list ap); } // namespace io +} // namespace tmwa #endif // TMWA_IO_WRITE_HPP diff --git a/src/io/write_test.cpp b/src/io/write_test.cpp index ff2553a..7219c4b 100644 --- a/src/io/write_test.cpp +++ b/src/io/write_test.cpp @@ -31,6 +31,8 @@ #include "../poison.hpp" +namespace tmwa +{ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" static @@ -104,3 +106,4 @@ TEST(io, write2) EXPECT_TRUE(wf.close()); EXPECT_EQ("XXX"_s, pw.slurp()); } +} // namespace tmwa -- cgit v1.2.3-70-g09d2