Mercurial > hg > xemacs-beta
comparison src/text.h @ 1632:64eaceca611d
[xemacs-hg @ 2003-08-19 02:07:03 by james]
Enable module building and running on Cygwin and MinGW.
author | james |
---|---|
date | Tue, 19 Aug 2003 02:07:16 +0000 |
parents | e9929b7b37ad |
children | 34abfb24e891 |
comparison
equal
deleted
inserted
replaced
1631:1bf7b032a45d | 1632:64eaceca611d |
---|---|
123 indexed by the first byte of that representation. | 123 indexed by the first byte of that representation. |
124 | 124 |
125 This value can be derived in other ways -- e.g. something like | 125 This value can be derived in other ways -- e.g. something like |
126 XCHARSET_REP_BYTES (charset_by_leading_byte (first_byte)) | 126 XCHARSET_REP_BYTES (charset_by_leading_byte (first_byte)) |
127 but it's faster this way. */ | 127 but it's faster this way. */ |
128 extern const Bytecount rep_bytes_by_first_byte[0xA0]; | 128 extern MODULE_API const Bytecount rep_bytes_by_first_byte[0xA0]; |
129 | 129 |
130 /* Number of bytes in the string representation of a character. */ | 130 /* Number of bytes in the string representation of a character. */ |
131 | 131 |
132 #ifdef ERROR_CHECK_TEXT | 132 #ifdef ERROR_CHECK_TEXT |
133 | 133 |
334 #define ichar_fits_in_format(ch, fmt, object) 1 | 334 #define ichar_fits_in_format(ch, fmt, object) 1 |
335 #define objects_have_same_internal_representation(srcobj, dstobj) 1 | 335 #define objects_have_same_internal_representation(srcobj, dstobj) 1 |
336 | 336 |
337 #endif /* MULE */ | 337 #endif /* MULE */ |
338 | 338 |
339 int dfc_coding_system_is_unicode (Lisp_Object codesys); | 339 MODULE_API int dfc_coding_system_is_unicode (Lisp_Object codesys); |
340 | 340 |
341 DECLARE_INLINE_HEADER ( | 341 DECLARE_INLINE_HEADER ( |
342 Bytecount dfc_external_data_len (const void *ptr, Lisp_Object codesys) | 342 Bytecount dfc_external_data_len (const void *ptr, Lisp_Object codesys) |
343 ) | 343 ) |
344 { | 344 { |
604 /* section of internally-formatted text */ | 604 /* section of internally-formatted text */ |
605 /* -------------------------------------------------------------- */ | 605 /* -------------------------------------------------------------- */ |
606 | 606 |
607 #ifdef MULE | 607 #ifdef MULE |
608 | 608 |
609 Charcount bytecount_to_charcount_fun (const Ibyte *ptr, Bytecount len); | 609 MODULE_API Charcount |
610 Bytecount charcount_to_bytecount_fun (const Ibyte *ptr, Charcount len); | 610 bytecount_to_charcount_fun (const Ibyte *ptr, Bytecount len); |
611 MODULE_API Bytecount | |
612 charcount_to_bytecount_fun (const Ibyte *ptr, Charcount len); | |
611 | 613 |
612 /* Given a pointer to a text string and a length in bytes, return | 614 /* Given a pointer to a text string and a length in bytes, return |
613 the equivalent length in characters. */ | 615 the equivalent length in characters. */ |
614 | 616 |
615 DECLARE_INLINE_HEADER ( | 617 DECLARE_INLINE_HEADER ( |
797 #define simple_itext_copy_ichar(src, dst) \ | 799 #define simple_itext_copy_ichar(src, dst) \ |
798 ((dst)[0] = *(src), (Bytecount) 1) | 800 ((dst)[0] = *(src), (Bytecount) 1) |
799 | 801 |
800 #ifdef MULE | 802 #ifdef MULE |
801 | 803 |
802 Ichar non_ascii_itext_ichar (const Ibyte *ptr); | 804 MODULE_API Ichar non_ascii_itext_ichar (const Ibyte *ptr); |
803 Bytecount non_ascii_set_itext_ichar (Ibyte *ptr, Ichar c); | 805 MODULE_API Bytecount non_ascii_set_itext_ichar (Ibyte *ptr, Ichar c); |
804 Bytecount non_ascii_itext_copy_ichar (const Ibyte *src, Ibyte *dst); | 806 MODULE_API Bytecount non_ascii_itext_copy_ichar (const Ibyte *src, Ibyte *dst); |
805 | 807 |
806 /* Retrieve the character pointed to by PTR as an Ichar. */ | 808 /* Retrieve the character pointed to by PTR as an Ichar. */ |
807 | 809 |
808 DECLARE_INLINE_HEADER ( | 810 DECLARE_INLINE_HEADER ( |
809 Ichar | 811 Ichar |
992 Ichar when converted to text, etc. | 994 Ichar when converted to text, etc. |
993 */ | 995 */ |
994 | 996 |
995 #ifdef MULE | 997 #ifdef MULE |
996 | 998 |
997 int non_ascii_valid_ichar_p (Ichar ch); | 999 MODULE_API int non_ascii_valid_ichar_p (Ichar ch); |
998 | 1000 |
999 /* Return whether the given Ichar is valid. | 1001 /* Return whether the given Ichar is valid. |
1000 */ | 1002 */ |
1001 | 1003 |
1002 DECLARE_INLINE_HEADER ( | 1004 DECLARE_INLINE_HEADER ( |
2689 typedef enum dfc_conversion_type dfc_conversion_type; | 2691 typedef enum dfc_conversion_type dfc_conversion_type; |
2690 | 2692 |
2691 /* WARNING: These use a static buffer. This can lead to disaster if | 2693 /* WARNING: These use a static buffer. This can lead to disaster if |
2692 these functions are not used *very* carefully. Another reason to only use | 2694 these functions are not used *very* carefully. Another reason to only use |
2693 TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */ | 2695 TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */ |
2694 void | 2696 MODULE_API void |
2695 dfc_convert_to_external_format (dfc_conversion_type source_type, | 2697 dfc_convert_to_external_format (dfc_conversion_type source_type, |
2696 dfc_conversion_data *source, | 2698 dfc_conversion_data *source, |
2697 Lisp_Object codesys, | 2699 Lisp_Object codesys, |
2698 dfc_conversion_type sink_type, | 2700 dfc_conversion_type sink_type, |
2699 dfc_conversion_data *sink); | 2701 dfc_conversion_data *sink); |
2700 void | 2702 MODULE_API void |
2701 dfc_convert_to_internal_format (dfc_conversion_type source_type, | 2703 dfc_convert_to_internal_format (dfc_conversion_type source_type, |
2702 dfc_conversion_data *source, | 2704 dfc_conversion_data *source, |
2703 Lisp_Object codesys, | 2705 Lisp_Object codesys, |
2704 dfc_conversion_type sink_type, | 2706 dfc_conversion_type sink_type, |
2705 dfc_conversion_data *sink); | 2707 dfc_conversion_data *sink); |
2884 DFC_INTERNAL, | 2886 DFC_INTERNAL, |
2885 DFC_SIZED_INTERNAL, | 2887 DFC_SIZED_INTERNAL, |
2886 DFC_LISP_STRING | 2888 DFC_LISP_STRING |
2887 }; | 2889 }; |
2888 | 2890 |
2889 void *new_dfc_convert_malloc (const void *src, Bytecount src_size, | 2891 MODULE_API void *new_dfc_convert_malloc (const void *src, Bytecount src_size, |
2890 enum new_dfc_src_type type, Lisp_Object codesys); | 2892 enum new_dfc_src_type type, |
2891 void *new_dfc_convert_alloca (const char *srctext, void *alloca_data); | 2893 Lisp_Object codesys); |
2892 Bytecount new_dfc_convert_size (const char *srctext, const void *src, | 2894 MODULE_API void *new_dfc_convert_alloca (const char *srctext, void *alloca_data); |
2893 Bytecount src_size, enum new_dfc_src_type type, | 2895 MODULE_API Bytecount new_dfc_convert_size (const char *srctext, const void *src, |
2894 Lisp_Object codesys); | 2896 Bytecount src_size, |
2897 enum new_dfc_src_type type, | |
2898 Lisp_Object codesys); | |
2895 | 2899 |
2896 /* Version of EXTERNAL_TO_C_STRING that *RETURNS* the translated string, | 2900 /* Version of EXTERNAL_TO_C_STRING that *RETURNS* the translated string, |
2897 still in alloca() space. Requires some trickiness to do this, but gets | 2901 still in alloca() space. Requires some trickiness to do this, but gets |
2898 it done! */ | 2902 it done! */ |
2899 | 2903 |