summaryrefslogtreecommitdiff
path: root/lib/win32/emu.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-03-10 19:05:52 +0000
committerChris Wilson <chris+github@qwirx.com>2007-03-10 19:05:52 +0000
commit40d737e975070ba43d15866b1b24e6e2d0922984 (patch)
tree77c63c384dbca0466db337c4cb19def29b6519a7 /lib/win32/emu.h
parent8ef165b887dfb88514e4d00a07fa4e3d0c53fbc1 (diff)
Reorder for clarity
Expose GetErrorMessage() Improve comments (refs #3, merges [1365])
Diffstat (limited to 'lib/win32/emu.h')
-rw-r--r--lib/win32/emu.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index c8e15f3c..f8bccb02 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -321,7 +321,7 @@ struct stat {
time_t st_mtime;
time_t st_ctime;
};
-#endif
+#endif // 0
// need this for conversions
time_t ConvertFileTimeToTime_t(FILETIME *fileTime);
@@ -349,6 +349,19 @@ char* emu_getcwd (char* pBuffer, int BufSize);
int statfs(const char * name, struct statfs * s);
int poll(struct pollfd *ufds, unsigned long nfds, int timeout);
+
+struct iovec {
+ void *iov_base; /* Starting address */
+ size_t iov_len; /* Number of bytes */
+};
+
+int readv (int filedes, const struct iovec *vector, size_t count);
+int writev(int filedes, const struct iovec *vector, size_t count);
+
+// The following functions are not emulations, but utilities for other
+// parts of the code where Windows API is used or windows-specific stuff
+// is needed, like codepage conversion.
+
bool EnableBackupRights( void );
bool ConvertEncoding (const std::string& rSource, int sourceCodePage,
@@ -360,15 +373,12 @@ bool ConvertFromUtf8 (const std::string& rSource, std::string& rDest,
bool ConvertUtf8ToConsole(const char* pString, std::string& rDest);
bool ConvertConsoleToUtf8(const char* pString, std::string& rDest);
-// replacement for _cgetws which requires a relatively recent C runtime lib
-int console_read(char* pBuffer, size_t BufferSize);
-
-struct iovec {
- void *iov_base; /* Starting address */
- size_t iov_len; /* Number of bytes */
-};
+// GetErrorMessage() returns a system error message, like strerror()
+// but for Windows error codes.
+std::string GetErrorMessage(DWORD errorCode);
-int readv (int filedes, const struct iovec *vector, size_t count);
-int writev(int filedes, const struct iovec *vector, size_t count);
+// console_read() is a replacement for _cgetws which requires a
+// relatively recent C runtime lib
+int console_read(char* pBuffer, size_t BufferSize);
#endif // !EMU_INCLUDE && WIN32