diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-13 23:09:47 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-13 23:09:47 -0800 |
commit | b1b4053ccc899fe0b79ffda8f0a282755c94983a (patch) | |
tree | 7a27355e0922dc01f8e7bdbaafacb4c5c5bd5433 /src | |
parent | b700e3c080521021bb7f8eb63a96def24112c16a (diff) |
Made buffer functions visible in shared library.
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 9cfd5b9..e1ff60a 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -11,7 +11,10 @@ typedef struct { int asize, size; } cmark_strbuf; +__attribute__((visibility("default"))) extern unsigned char cmark_strbuf__initbuf[]; + +__attribute__((visibility("default"))) extern unsigned char cmark_strbuf__oom[]; #define CMARK_GH_BUF_INIT { cmark_strbuf__initbuf, 0, 0 } @@ -22,6 +25,7 @@ extern unsigned char cmark_strbuf__oom[]; * For the cases where GH_BUF_INIT cannot be used to do static * initialization. */ +__attribute__((visibility("default"))) extern void cmark_strbuf_init(cmark_strbuf *buf, int initial_size); /** @@ -32,6 +36,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"))) extern int cmark_strbuf_try_grow(cmark_strbuf *buf, int target_size, bool mark_oom); /** @@ -47,7 +52,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"))) extern void cmark_strbuf_free(cmark_strbuf *buf); +__attribute__((visibility("default"))) extern void cmark_strbuf_swap(cmark_strbuf *buf_a, cmark_strbuf *buf_b); /** @@ -72,10 +79,14 @@ static inline size_t cmark_strbuf_len(const cmark_strbuf *buf) return buf->size; } +__attribute__((visibility("default"))) extern int cmark_strbuf_cmp(const cmark_strbuf *a, const cmark_strbuf *b); +__attribute__((visibility("default"))) extern void cmark_strbuf_attach(cmark_strbuf *buf, unsigned char *ptr, int asize); +__attribute__((visibility("default"))) extern unsigned char *cmark_strbuf_detach(cmark_strbuf *buf); +__attribute__((visibility("default"))) 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) @@ -93,23 +104,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"))) extern int cmark_strbuf_set(cmark_strbuf *buf, const unsigned char *data, int len); +__attribute__((visibility("default"))) extern int cmark_strbuf_sets(cmark_strbuf *buf, const char *string); +__attribute__((visibility("default"))) extern int cmark_strbuf_putc(cmark_strbuf *buf, int c); +__attribute__((visibility("default"))) extern int cmark_strbuf_put(cmark_strbuf *buf, const unsigned char *data, int len); +__attribute__((visibility("default"))) extern int cmark_strbuf_puts(cmark_strbuf *buf, const char *string); +__attribute__((visibility("default"))) extern int cmark_strbuf_printf(cmark_strbuf *buf, const char *format, ...) __attribute__((format (printf, 2, 3))); +__attribute__((visibility("default"))) extern int cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap); +__attribute__((visibility("default"))) extern void cmark_strbuf_clear(cmark_strbuf *buf); +__attribute__((visibility("default"))) int cmark_strbuf_strchr(const cmark_strbuf *buf, int c, int pos); +__attribute__((visibility("default"))) int cmark_strbuf_strrchr(const cmark_strbuf *buf, int c, int pos); +__attribute__((visibility("default"))) void cmark_strbuf_drop(cmark_strbuf *buf, int n); +__attribute__((visibility("default"))) void cmark_strbuf_truncate(cmark_strbuf *buf, int len); +__attribute__((visibility("default"))) void cmark_strbuf_rtrim(cmark_strbuf *buf); +__attribute__((visibility("default"))) void cmark_strbuf_trim(cmark_strbuf *buf); +__attribute__((visibility("default"))) void cmark_strbuf_normalize_whitespace(cmark_strbuf *s); +__attribute__((visibility("default"))) void cmark_strbuf_unescape(cmark_strbuf *s); #ifndef CMARK_NO_SHORT_NAMES |