Mercurial > hg > xemacs-beta
comparison src/file-coding.c @ 3425:ca9976dc328e
[xemacs-hg @ 2006-05-25 08:04:56 by aidan]
Last build problem was with eicpy_ext, not stderr_out.
author | aidan |
---|---|
date | Thu, 25 May 2006 08:04:57 +0000 |
parents | a9bb932a03b5 |
children | 6b2ef948e140 |
comparison
equal
deleted
inserted
replaced
3424:3204267bfd9d | 3425:ca9976dc328e |
---|---|
3365 } | 3365 } |
3366 | 3366 |
3367 static void | 3367 static void |
3368 output_bytes_in_ascii_and_hex (const UExtbyte *src, Bytecount n) | 3368 output_bytes_in_ascii_and_hex (const UExtbyte *src, Bytecount n) |
3369 { | 3369 { |
3370 UExtbyte *ascii = alloca_array (UExtbyte, n + 1); | 3370 Extbyte *ascii = alloca_array (Extbyte, n + 1); |
3371 UExtbyte *hex = alloca_array (UExtbyte, 3 * n + 1); | 3371 Extbyte *hex = alloca_array (Extbyte, 3 * n + 1); |
3372 int i; | 3372 int i; |
3373 DECLARE_EISTRING (eistr_ascii); | 3373 DECLARE_EISTRING (eistr_ascii); |
3374 DECLARE_EISTRING (eistr_hex); | 3374 DECLARE_EISTRING (eistr_hex); |
3375 | 3375 |
3376 for (i = 0; i < n; i++) | 3376 for (i = 0; i < n; i++) |
3377 { | 3377 { |
3378 UExtbyte c = src[i]; | 3378 Extbyte c = src[i]; |
3379 if (c < 0x20) | 3379 if (c < 0x20) |
3380 ascii[i] = '.'; | 3380 ascii[i] = '.'; |
3381 else | 3381 else |
3382 ascii[i] = c; | 3382 ascii[i] = c; |
3383 hex[3 * i] = hex_digit_to_char (c >> 4); | 3383 hex[3 * i] = hex_digit_to_char (c >> 4); |
3388 hex[3 * i - 1] = '\0'; | 3388 hex[3 * i - 1] = '\0'; |
3389 | 3389 |
3390 eicpy_ext(eistr_hex, hex, Qbinary); | 3390 eicpy_ext(eistr_hex, hex, Qbinary); |
3391 eicpy_ext(eistr_ascii, ascii, Qbinary); | 3391 eicpy_ext(eistr_ascii, ascii, Qbinary); |
3392 | 3392 |
3393 stderr_out ("%s %s", (const CIbyte *)(eidata(eistr_ascii)), | 3393 stderr_out ("%s %s", eidata(eistr_ascii), eidata(eistr_hex)); |
3394 (const CIbyte *)eidata(eistr_hex)); | |
3395 } | 3394 } |
3396 | 3395 |
3397 #endif /* DEBUG_XEMACS */ | 3396 #endif /* DEBUG_XEMACS */ |
3398 | 3397 |
3399 /* Attempt to determine the encoding of the given text. Before calling | 3398 /* Attempt to determine the encoding of the given text. Before calling |