[Box Backup-commit] COMMIT r1412 - box/chris/merge/lib/win32
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Mar 10 19:05:52 GMT 2007
Author: chris
Date: 2007-03-10 19:05:52 +0000 (Sat, 10 Mar 2007)
New Revision: 1412
Modified:
box/chris/merge/lib/win32/emu.h
Log:
Reorder for clarity
Expose GetErrorMessage()
Improve comments
(refs #3, merges [1365])
Modified: box/chris/merge/lib/win32/emu.h
===================================================================
--- box/chris/merge/lib/win32/emu.h 2007-03-10 19:03:37 UTC (rev 1411)
+++ box/chris/merge/lib/win32/emu.h 2007-03-10 19:05:52 UTC (rev 1412)
@@ -321,7 +321,7 @@
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 @@
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 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
+// GetErrorMessage() returns a system error message, like strerror()
+// but for Windows error codes.
+std::string GetErrorMessage(DWORD errorCode);
+
+// console_read() is a 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 */
-};
-
-int readv (int filedes, const struct iovec *vector, size_t count);
-int writev(int filedes, const struct iovec *vector, size_t count);
-
#endif // !EMU_INCLUDE && WIN32
More information about the Boxbackup-commit
mailing list