diff options
-rw-r--r-- | src/cmark.h | 2 | ||||
-rw-r--r-- | src/inlines.h | 4 | ||||
-rw-r--r-- | src/references.h | 29 |
3 files changed, 22 insertions, 13 deletions
diff --git a/src/cmark.h b/src/cmark.h index 63b60dc..f49c162 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -100,7 +100,7 @@ struct node_block { int level; } header; struct { - reference_map *refmap; + cmark_reference_map *refmap; } document; } as; diff --git a/src/inlines.h b/src/inlines.h index 93a1dc6..bcbf5a6 100644 --- a/src/inlines.h +++ b/src/inlines.h @@ -5,10 +5,10 @@ unsigned char *cmark_clean_url(cmark_chunk *url); unsigned char *cmark_clean_autolink(cmark_chunk *url, int is_email); unsigned char *cmark_clean_title(cmark_chunk *title); -node_inl* cmark_parse_inlines(cmark_strbuf *input, reference_map *refmap); +node_inl* cmark_parse_inlines(cmark_strbuf *input, cmark_reference_map *refmap); void cmark_free_inlines(node_inl* e); -int cmark_parse_reference_inline(cmark_strbuf *input, reference_map *refmap); +int cmark_parse_reference_inline(cmark_strbuf *input, cmark_reference_map *refmap); #ifndef CMARK_NO_SHORT_NAMES #define clean_url cmark_clean_url diff --git a/src/references.h b/src/references.h index 82596ca..1bc187a 100644 --- a/src/references.h +++ b/src/references.h @@ -3,25 +3,34 @@ #define REFMAP_SIZE 16 -struct reference { - struct reference *next; +struct cmark_reference { + struct cmark_reference *next; unsigned char *label; unsigned char *url; unsigned char *title; unsigned int hash; }; -typedef struct reference reference; +typedef struct cmark_reference cmark_reference; -struct reference_map { - reference *table[REFMAP_SIZE]; +struct cmark_reference_map { + cmark_reference *table[REFMAP_SIZE]; }; -typedef struct reference_map reference_map; +typedef struct cmark_reference_map cmark_reference_map; -reference_map *reference_map_new(void); -void reference_map_free(reference_map *map); -reference* reference_lookup(reference_map *map, cmark_chunk *label); -extern void reference_create(reference_map *map, cmark_chunk *label, cmark_chunk *url, cmark_chunk *title); +cmark_reference_map *cmark_reference_map_new(void); +void cmark_reference_map_free(cmark_reference_map *map); +cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label); +extern void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url, cmark_chunk *title); + +#ifndef CMARK_NO_SHORT_NAMES + #define reference cmark_reference + #define reference_map cmark_reference_map + #define reference_map_new cmark_reference_map_new + #define reference_map_free cmark_reference_map_free + #define reference_lookup cmark_reference_lookup + #define reference_create cmark_reference_create +#endif #endif |