Mercurial > hg > xemacs-beta
comparison lib-src/hexl.c @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | 74fd4e045ea6 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
2 | 2 |
3 #include <config.h> | 3 #include <config.h> |
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <ctype.h> | 6 #include <ctype.h> |
7 #ifdef WINDOWSNT | 7 #ifdef WIN32_NATIVE |
8 #include <io.h> | 8 #include <io.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #if __STDC__ || defined(STDC_HEADERS) | 12 #if __STDC__ || defined(STDC_HEADERS) |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 #ifdef HAVE_UNISTD_H | |
14 #include <unistd.h> | 15 #include <unistd.h> |
16 #endif | |
15 #include <string.h> | 17 #include <string.h> |
16 #endif | 18 #endif |
17 | 19 |
18 #define DEFAULT_GROUPING 0x01 | 20 #define DEFAULT_GROUPING 0x01 |
19 #define DEFAULT_BASE 16 | 21 #define DEFAULT_BASE 16 |
140 | 142 |
141 if (un_flag) | 143 if (un_flag) |
142 { | 144 { |
143 char buf[18]; | 145 char buf[18]; |
144 | 146 |
145 #ifdef WINDOWSNT | 147 #ifdef WIN32_NATIVE |
146 _setmode (_fileno (stdout), O_BINARY); | 148 _setmode (_fileno (stdout), O_BINARY); |
147 #endif | 149 #endif |
148 for (;;) | 150 for (;;) |
149 { | 151 { |
150 register int i, c, d; | 152 register int i, c, d; |
183 } | 185 } |
184 } | 186 } |
185 } | 187 } |
186 else | 188 else |
187 { | 189 { |
188 #ifdef WINDOWSNT | 190 #ifdef WIN32_NATIVE |
189 _setmode (_fileno (fp), O_BINARY); | 191 _setmode (_fileno (fp), O_BINARY); |
190 #endif | 192 #endif |
191 address = 0; | 193 address = 0; |
192 string[0] = ' '; | 194 string[0] = ' '; |
193 string[17] = '\0'; | 195 string[17] = '\0'; |
240 } while (*argv != NULL); | 242 } while (*argv != NULL); |
241 return 0; | 243 return 0; |
242 } | 244 } |
243 | 245 |
244 void | 246 void |
245 usage () | 247 usage (void) |
246 { | 248 { |
247 (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); | 249 (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); |
248 exit (1); | 250 exit (1); |
249 } | 251 } |