1#ifndef CMARK_REFERENCES_H
2#define CMARK_REFERENCES_H
3
4#include "chunk.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10struct cmark_reference {
11 struct cmark_reference *next;
12 unsigned char *label;
13 unsigned char *url;
14 unsigned char *title;
15 unsigned int age;
16 unsigned int size;
17};
18
19typedef struct cmark_reference cmark_reference;
20
21struct cmark_reference_map {
22 cmark_mem *mem;
23 cmark_reference *refs;
24 cmark_reference **sorted;
25 unsigned int size;
26 unsigned int ref_size;
27 unsigned int max_ref_size;
28};
29
30typedef struct cmark_reference_map cmark_reference_map;
31
32cmark_reference_map *cmark_reference_map_new(cmark_mem *mem);
33void cmark_reference_map_free(cmark_reference_map *map);
34cmark_reference *cmark_reference_lookup(cmark_reference_map *map,
35 cmark_chunk *label);
36extern void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label,
37 cmark_chunk *url, cmark_chunk *title);
38
39#ifdef __cplusplus
40}
41#endif
42
43#endif
44