diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-31 05:15:38 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-31 05:15:38 +0100 |
commit | d8528b8e56bab7643722e4453121882d23c23c07 (patch) | |
tree | c742df066326cd571327b10d4cca3341c798d129 /include/libbb.h | |
parent | ed910c750d7908a31262488e04d38b7bf3d75322 (diff) | |
download | busybox-w32-d8528b8e56bab7643722e4453121882d23c23c07.tar.gz busybox-w32-d8528b8e56bab7643722e4453121882d23c23c07.tar.bz2 busybox-w32-d8528b8e56bab7643722e4453121882d23c23c07.zip |
ls: unicode fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h index 73aea409e..a86d64400 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -577,11 +577,6 @@ char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC; | |||
577 | * But potentially slow, don't use in one-billion-times loops */ | 577 | * But potentially slow, don't use in one-billion-times loops */ |
578 | int bb_putchar(int ch) FAST_FUNC; | 578 | int bb_putchar(int ch) FAST_FUNC; |
579 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; | 579 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; |
580 | /* Prints unprintable chars ch as ^C or M-c to file | ||
581 | * (M-c is used only if ch is ORed with PRINTABLE_META), | ||
582 | * else it is printed as-is (except for ch = 0x9b) */ | ||
583 | enum { PRINTABLE_META = 0x100 }; | ||
584 | void fputc_printable(int ch, FILE *file) FAST_FUNC; | ||
585 | // gcc-4.1.1 still isn't good enough at optimizing it | 580 | // gcc-4.1.1 still isn't good enough at optimizing it |
586 | // (+200 bytes compared to macro) | 581 | // (+200 bytes compared to macro) |
587 | //static ALWAYS_INLINE | 582 | //static ALWAYS_INLINE |
@@ -594,6 +589,20 @@ void fputc_printable(int ch, FILE *file) FAST_FUNC; | |||
594 | #define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1]) | 589 | #define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1]) |
595 | #define DOT_OR_DOTDOT(s) ((s)[0] == '.' && (!(s)[1] || ((s)[1] == '.' && !(s)[2]))) | 590 | #define DOT_OR_DOTDOT(s) ((s)[0] == '.' && (!(s)[1] || ((s)[1] == '.' && !(s)[2]))) |
596 | 591 | ||
592 | typedef struct uni_stat_t { | ||
593 | unsigned byte_count; | ||
594 | unsigned unicode_count; | ||
595 | unsigned unicode_width; | ||
596 | } uni_stat_t; | ||
597 | /* Returns a string with unprintable chars replaced by '?' or | ||
598 | * SUBST_WCHAR. This function is unicode-aware. */ | ||
599 | const char* FAST_FUNC printable_string(uni_stat_t *stats, const char *str); | ||
600 | /* Prints unprintable char ch as ^C or M-c to file | ||
601 | * (M-c is used only if ch is ORed with PRINTABLE_META), | ||
602 | * else it is printed as-is (except for ch = 0x9b) */ | ||
603 | enum { PRINTABLE_META = 0x100 }; | ||
604 | void fputc_printable(int ch, FILE *file) FAST_FUNC; | ||
605 | |||
597 | /* dmalloc will redefine these to it's own implementation. It is safe | 606 | /* dmalloc will redefine these to it's own implementation. It is safe |
598 | * to have the prototypes here unconditionally. */ | 607 | * to have the prototypes here unconditionally. */ |
599 | void *malloc_or_warn(size_t size) FAST_FUNC RETURNS_MALLOC; | 608 | void *malloc_or_warn(size_t size) FAST_FUNC RETURNS_MALLOC; |