From e68262dab6fb017524a4b7bafded292c34071ccc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 14 Nov 2014 12:18:18 -0800 Subject: Use cmake's generate_export_header. --- src/buffer.h | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'src/buffer.h') diff --git a/src/buffer.h b/src/buffer.h index e1ff60a..7214faf 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -5,16 +5,17 @@ #include #include #include +#include "cmark_export.h" typedef struct { unsigned char *ptr; int asize, size; } cmark_strbuf; -__attribute__((visibility("default"))) +CMARK_EXPORT extern unsigned char cmark_strbuf__initbuf[]; -__attribute__((visibility("default"))) +CMARK_EXPORT extern unsigned char cmark_strbuf__oom[]; #define CMARK_GH_BUF_INIT { cmark_strbuf__initbuf, 0, 0 } @@ -25,7 +26,7 @@ extern unsigned char cmark_strbuf__oom[]; * For the cases where GH_BUF_INIT cannot be used to do static * initialization. */ -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_init(cmark_strbuf *buf, int initial_size); /** @@ -36,7 +37,7 @@ extern void cmark_strbuf_init(cmark_strbuf *buf, int initial_size); * existing buffer content will be preserved, but calling code must handle * that buffer was not expanded. */ -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_try_grow(cmark_strbuf *buf, int target_size, bool mark_oom); /** @@ -52,9 +53,9 @@ static inline int cmark_strbuf_grow(cmark_strbuf *buf, int target_size) return cmark_strbuf_try_grow(buf, target_size, true); } -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_free(cmark_strbuf *buf); -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_swap(cmark_strbuf *buf_a, cmark_strbuf *buf_b); /** @@ -79,14 +80,14 @@ static inline size_t cmark_strbuf_len(const cmark_strbuf *buf) return buf->size; } -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_cmp(const cmark_strbuf *a, const cmark_strbuf *b); -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_attach(cmark_strbuf *buf, unsigned char *ptr, int asize); -__attribute__((visibility("default"))) +CMARK_EXPORT extern unsigned char *cmark_strbuf_detach(cmark_strbuf *buf); -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_copy_cstr(char *data, int datasize, const cmark_strbuf *buf); static inline const char *cmark_strbuf_cstr(const cmark_strbuf *buf) @@ -104,39 +105,39 @@ static inline const char *cmark_strbuf_cstr(const cmark_strbuf *buf) * return code of these functions and call them in a series then just call * strbuf_oom at the end. */ -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_set(cmark_strbuf *buf, const unsigned char *data, int len); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_sets(cmark_strbuf *buf, const char *string); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_putc(cmark_strbuf *buf, int c); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_put(cmark_strbuf *buf, const unsigned char *data, int len); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_puts(cmark_strbuf *buf, const char *string); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_printf(cmark_strbuf *buf, const char *format, ...) __attribute__((format (printf, 2, 3))); -__attribute__((visibility("default"))) +CMARK_EXPORT extern int cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap); -__attribute__((visibility("default"))) +CMARK_EXPORT extern void cmark_strbuf_clear(cmark_strbuf *buf); -__attribute__((visibility("default"))) +CMARK_EXPORT int cmark_strbuf_strchr(const cmark_strbuf *buf, int c, int pos); -__attribute__((visibility("default"))) +CMARK_EXPORT int cmark_strbuf_strrchr(const cmark_strbuf *buf, int c, int pos); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_drop(cmark_strbuf *buf, int n); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_truncate(cmark_strbuf *buf, int len); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_rtrim(cmark_strbuf *buf); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_trim(cmark_strbuf *buf); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_normalize_whitespace(cmark_strbuf *s); -__attribute__((visibility("default"))) +CMARK_EXPORT void cmark_strbuf_unescape(cmark_strbuf *s); #ifndef CMARK_NO_SHORT_NAMES -- cgit v1.2.3