aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2009-04-20 22:54:37 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2009-04-20 22:54:37 +0000
commit3126d6d8a36c9bc7c5dba99f86eaa297202ab8cf (patch)
tree82bfb414eb4e5a084cf9fe4fdd2b088faa3c6dc5 /utils
parent9edb81a37990a9f12c198c757f51e74439af6c15 (diff)
downloadsg3_utils-3126d6d8a36c9bc7c5dba99f86eaa297202ab8cf.tar.gz
don't have sg_lib
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@255 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'utils')
-rw-r--r--utils/hxascdmp.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/hxascdmp.c b/utils/hxascdmp.c
index f5b3492f..1a4105c8 100644
--- a/utils/hxascdmp.c
+++ b/utils/hxascdmp.c
@@ -46,6 +46,40 @@ static const char * version_str = "1.11 20090420";
#define MAX_LINE_LENGTH 257
+#ifdef SG3_UTILS_MINGW
+/* Non Unix OSes distinguish between text and binary files.
+ Set text mode on fd. Does nothing in Unix. Returns negative number on
+ failure. */
+int
+sg_set_text_mode(int fd)
+{
+ return setmode(fd, O_TEXT);
+}
+
+/* Set binary mode on fd. Does nothing in Unix. Returns negative number on
+ failure. */
+int
+sg_set_binary_mode(int fd)
+{
+ return setmode(fd, O_BINARY);
+}
+
+#else
+/* For Unix the following functions are dummies. */
+int
+sg_set_text_mode(int fd)
+{
+ return fd; /* fd should be >= 0 */
+}
+
+int
+sg_set_binary_mode(int fd)
+{
+ return fd;
+}
+#endif
+
+
static void
dStrHex(const char* str, int len, long start)
{