From 3126d6d8a36c9bc7c5dba99f86eaa297202ab8cf Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Mon, 20 Apr 2009 22:54:37 +0000 Subject: don't have sg_lib git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@255 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- utils/hxascdmp.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'utils') 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) { -- cgit v1.2.3