aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h19
-rw-r--r--include/unicode.h5
2 files changed, 14 insertions, 10 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 */
578int bb_putchar(int ch) FAST_FUNC; 578int bb_putchar(int ch) FAST_FUNC;
579char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; 579char *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) */
583enum { PRINTABLE_META = 0x100 };
584void 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
592typedef 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. */
599const 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) */
603enum { PRINTABLE_META = 0x100 };
604void 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. */
599void *malloc_or_warn(size_t size) FAST_FUNC RETURNS_MALLOC; 608void *malloc_or_warn(size_t size) FAST_FUNC RETURNS_MALLOC;
diff --git a/include/unicode.h b/include/unicode.h
index f32e56599..25ef7407e 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -23,11 +23,6 @@ size_t FAST_FUNC unicode_strlen(const char *string);
23enum { 23enum {
24 UNI_FLAG_PAD = (1 << 0), 24 UNI_FLAG_PAD = (1 << 0),
25}; 25};
26typedef struct uni_stat_t {
27 unsigned byte_count;
28 unsigned unicode_count;
29 unsigned unicode_width;
30} uni_stat_t;
31//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src); 26//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src);
32//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags); 27//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags);
33char* FAST_FUNC unicode_conv_to_printable(uni_stat_t *stats, const char *src); 28char* FAST_FUNC unicode_conv_to_printable(uni_stat_t *stats, const char *src);