X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/3bace81626cc6ecdffc7901f3d03aa051d18c0af..dd4d3d3a52ef79721f40363e87c725327c2a155b:/src/character.h diff --git a/src/character.h b/src/character.h index 88de343b22..b2cdcb7669 100644 --- a/src/character.h +++ b/src/character.h @@ -25,6 +25,11 @@ along with GNU Emacs. If not, see . */ #include +INLINE_HEADER_BEGIN +#ifndef CHARACTER_INLINE +# define CHARACTER_INLINE INLINE +#endif + /* character code 1st byte byte sequence -------------- -------- ------------- 0-7F 00..7F 0xxxxxxx @@ -434,7 +439,7 @@ along with GNU Emacs. If not, see . */ unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \ int chlen; \ \ - OUTPUT= STRING_CHAR_AND_LENGTH (chp, chlen); \ + OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \ BYTEIDX += chlen; \ } \ else \ @@ -549,28 +554,11 @@ along with GNU Emacs. If not, see . */ } while (0) -/* If C is a character to be unified with a Unicode character, return - the unified Unicode character. */ - -#define MAYBE_UNIFY_CHAR(c) \ - do { \ - if (c > MAX_UNICODE_CHAR && c <= MAX_5_BYTE_CHAR) \ - { \ - Lisp_Object val; \ - val = CHAR_TABLE_REF (Vchar_unify_table, c); \ - if (INTEGERP (val)) \ - c = XFASTINT (val); \ - else if (! NILP (val)) \ - c = maybe_unify_char (c, val); \ - } \ - } while (0) - - /* Return a non-outlandish value for the tab width. */ #define SANE_TAB_WIDTH(buf) \ sanitize_tab_width (XFASTINT (BVAR (buf, tab_width))) -static inline int +CHARACTER_INLINE int sanitize_tab_width (EMACS_INT width) { return 0 < width && width <= 1000 ? width : 8; @@ -591,7 +579,7 @@ sanitize_tab_width (EMACS_INT width) /* Return a non-outlandish value for a character width. */ -static inline int +CHARACTER_INLINE int sanitize_char_width (EMACS_INT width) { return 0 <= width && width <= 1000 ? width : 1000; @@ -665,27 +653,26 @@ typedef enum { UNICODE_CATEGORY_Cn } unicode_category_t; -extern int char_resolve_modifier_mask (int); +extern EMACS_INT char_resolve_modifier_mask (EMACS_INT) ATTRIBUTE_CONST; extern int char_string (unsigned, unsigned char *); extern int string_char (const unsigned char *, const unsigned char **, int *); extern int translate_char (Lisp_Object, int c); -extern int char_printable_p (int c); extern void parse_str_as_multibyte (const unsigned char *, - EMACS_INT, EMACS_INT *, EMACS_INT *); -extern EMACS_INT count_size_as_multibyte (const unsigned char *, EMACS_INT); -extern EMACS_INT str_as_multibyte (unsigned char *, EMACS_INT, EMACS_INT, - EMACS_INT *); -extern EMACS_INT str_to_multibyte (unsigned char *, EMACS_INT, EMACS_INT); -extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); -extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, - EMACS_INT, int); -extern EMACS_INT strwidth (const char *, EMACS_INT); -extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, - EMACS_INT *, EMACS_INT *); -extern EMACS_INT lisp_string_width (Lisp_Object, EMACS_INT, - EMACS_INT *, EMACS_INT *); + ptrdiff_t, ptrdiff_t *, ptrdiff_t *); +extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); +extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t, + ptrdiff_t *); +extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); +extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); +extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, + ptrdiff_t); +extern ptrdiff_t strwidth (const char *, ptrdiff_t); +extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, + ptrdiff_t *, ptrdiff_t *); +extern ptrdiff_t lisp_string_width (Lisp_Object, ptrdiff_t, + ptrdiff_t *, ptrdiff_t *); extern Lisp_Object Qcharacterp; extern Lisp_Object Vchar_unify_table; @@ -695,4 +682,6 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object); #define GET_TRANSLATION_TABLE(id) \ (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)])) +INLINE_HEADER_END + #endif /* EMACS_CHARACTER_H */