diff options
author | Steven G. Johnson <stevenj@mit.edu> | 2014-09-24 14:26:13 -0400 |
---|---|---|
committer | Steven G. Johnson <stevenj@mit.edu> | 2014-09-24 14:26:13 -0400 |
commit | df71da45dfbdf68bcc6fd656d1260d609c728ad7 (patch) | |
tree | 278de56be1c6551277191ec1d272d01f4d20180d /mojibake.h | |
parent | a733c7feb489ebea9ec39750cde497fbc6d84b4a (diff) | |
parent | d61d551d5a4cb5a47e244928bc87fc95a4a4e88a (diff) | |
download | libutf8proc-df71da45dfbdf68bcc6fd656d1260d609c728ad7.tar.gz libutf8proc-df71da45dfbdf68bcc6fd656d1260d609c728ad7.tar.bz2 |
Merge pull request #17 from JuliaLang/tk/dllexport
RFC: add DLLEXPORT to utf8proc_get_property
Diffstat (limited to 'mojibake.h')
-rw-r--r-- | mojibake.h | 42 |
1 files changed, 27 insertions, 15 deletions
@@ -75,6 +75,18 @@ enum {false, true}; #endif #include <limits.h> +#ifdef _WIN32 +# ifdef MOJIBAKE_EXPORTS +# define DLLEXPORT __declspec(dllexport) +# else +# define DLLEXPORT __declspec(dllimport) +# endif +#elif __GNUC__ >= 4 +# define DLLEXPORT __attribute__ ((visibility("default"))) +#else +# define DLLEXPORT +#endif + #ifdef __cplusplus extern "C" { #endif @@ -241,16 +253,16 @@ typedef struct utf8proc_property_struct { #define UTF8PROC_DECOMP_TYPE_FRACTION 15 #define UTF8PROC_DECOMP_TYPE_COMPAT 16 -extern const int8_t utf8proc_utf8class[256]; +DLLEXPORT extern const int8_t utf8proc_utf8class[256]; -const char *utf8proc_version(void); +DLLEXPORT const char *utf8proc_version(void); -const char *utf8proc_errmsg(ssize_t errcode); +DLLEXPORT const char *utf8proc_errmsg(ssize_t errcode); /* * Returns a static error string for the given error code. */ -ssize_t utf8proc_iterate(const uint8_t *str, ssize_t strlen, int32_t *dst); +DLLEXPORT ssize_t utf8proc_iterate(const uint8_t *str, ssize_t strlen, int32_t *dst); /* * Reads a single char from the UTF-8 sequence being pointed to by 'str'. * The maximum number of bytes read is 'strlen', unless 'strlen' is @@ -261,12 +273,12 @@ ssize_t utf8proc_iterate(const uint8_t *str, ssize_t strlen, int32_t *dst); * negative error code is returned. */ -bool utf8proc_codepoint_valid(int32_t uc); +DLLEXPORT bool utf8proc_codepoint_valid(int32_t uc); /* * Returns 1, if the given unicode code-point is valid, otherwise 0. */ -ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst); +DLLEXPORT ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst); /* * Encodes the unicode char with the code point 'uc' as an UTF-8 string in * the byte array being pointed to by 'dst'. This array has to be at least @@ -276,7 +288,7 @@ ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst); * This function does not check if 'uc' is a valid unicode code point. */ -const utf8proc_property_t *utf8proc_get_property(int32_t uc); +DLLEXPORT const utf8proc_property_t *utf8proc_get_property(int32_t uc); /* * Returns a pointer to a (constant) struct containing information about * the unicode char with the given code point 'uc'. @@ -286,7 +298,7 @@ const utf8proc_property_t *utf8proc_get_property(int32_t uc); * 0x10FFFF, otherwise the program might crash! */ -ssize_t utf8proc_decompose_char( +DLLEXPORT ssize_t utf8proc_decompose_char( int32_t uc, int32_t *dst, ssize_t bufsize, int options, int *last_boundclass ); @@ -314,7 +326,7 @@ ssize_t utf8proc_decompose_char( * 0x10FFFF, otherwise the program might crash! */ -ssize_t utf8proc_decompose( +DLLEXPORT ssize_t utf8proc_decompose( const uint8_t *str, ssize_t strlen, int32_t *buffer, ssize_t bufsize, int options ); @@ -332,7 +344,7 @@ ssize_t utf8proc_decompose( * buffer size is returned. */ -ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, int options); +DLLEXPORT ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, int options); /* * Reencodes the sequence of unicode characters given by the pointer * 'buffer' and 'length' as UTF-8. @@ -355,7 +367,7 @@ ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, int options); * crash! */ -ssize_t utf8proc_map( +DLLEXPORT ssize_t utf8proc_map( const uint8_t *str, ssize_t strlen, uint8_t **dstptr, int options ); /* @@ -374,10 +386,10 @@ ssize_t utf8proc_map( * 'malloc', and has theirfore to be freed with 'free'. */ -uint8_t *utf8proc_NFD(const uint8_t *str); -uint8_t *utf8proc_NFC(const uint8_t *str); -uint8_t *utf8proc_NFKD(const uint8_t *str); -uint8_t *utf8proc_NFKC(const uint8_t *str); +DLLEXPORT uint8_t *utf8proc_NFD(const uint8_t *str); +DLLEXPORT uint8_t *utf8proc_NFC(const uint8_t *str); +DLLEXPORT uint8_t *utf8proc_NFKD(const uint8_t *str); +DLLEXPORT uint8_t *utf8proc_NFKC(const uint8_t *str); /* * Returns a pointer to newly allocated memory of a NFD, NFC, NFKD or NFKC * normalized version of the null-terminated string 'str'. |