summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-14 12:18:18 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-14 12:18:18 -0800
commite68262dab6fb017524a4b7bafded292c34071ccc (patch)
treec10f85b7790552817a8f8feefd4a4df5ba63b116 /src/buffer.h
parentee36eb3020ccc659587e0aba743432a74e46c5d8 (diff)
Use cmake's generate_export_header.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h53
1 files changed, 27 insertions, 26 deletions
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 <stddef.h>
#include <stdarg.h>
#include <sys/types.h>
+#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