Mercurial > hg > xemacs-beta
diff lib-src/hexl.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | de805c49cfc1 |
children | 11054d720c21 |
line wrap: on
line diff
--- a/lib-src/hexl.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/hexl.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,19 +1,16 @@ /* Synched up with: FSF 19.28. */ -#include <config.h> +#include <../src/config.h> #include <stdio.h> #include <ctype.h> -#ifdef WIN32_NATIVE -#include <io.h> +#ifdef MSDOS #include <fcntl.h> #endif #if __STDC__ || defined(STDC_HEADERS) #include <stdlib.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <string.h> #endif @@ -32,7 +29,9 @@ void usage (void); int -main (int argc, char *argv[]) +main(argc, argv) + int argc; + char *argv[]; { register long address; char string[18]; @@ -144,8 +143,9 @@ { char buf[18]; -#ifdef WIN32_NATIVE - _setmode (_fileno (stdout), O_BINARY); +#ifdef MSDOS + (stdout)->_flag &= ~_IOTEXT; /* print binary */ + _setmode (fileno (stdout), O_BINARY); #endif for (;;) { @@ -187,8 +187,9 @@ } else { -#ifdef WIN32_NATIVE - _setmode (_fileno (fp), O_BINARY); +#ifdef MSDOS + (fp)->_flag &= ~_IOTEXT; /* read binary */ + _setmode (fileno (fp), O_BINARY); #endif address = 0; string[0] = ' '; @@ -244,7 +245,7 @@ } void -usage (void) +usage () { (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); exit (1);