aboutsummaryrefslogtreecommitdiff
path: root/src/references.h
blob: c4ca6df48cf2f25b215f2a640783d43d055407a3 (plain)
  1. #ifndef _REFERENCES_H_
  2. #define _REFERENCES_H_
  3. #define REFMAP_SIZE 16
  4. #include "chunk.h"
  5. struct cmark_reference {
  6. struct cmark_reference *next;
  7. unsigned char *label;
  8. unsigned char *url;
  9. unsigned char *title;
  10. unsigned int hash;
  11. };
  12. typedef struct cmark_reference cmark_reference;
  13. struct cmark_reference_map {
  14. cmark_reference *table[REFMAP_SIZE];
  15. };
  16. typedef struct cmark_reference_map cmark_reference_map;
  17. cmark_reference_map *cmark_reference_map_new(void);
  18. void cmark_reference_map_free(cmark_reference_map *map);
  19. cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label);
  20. extern void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url, cmark_chunk *title);
  21. #ifndef CMARK_NO_SHORT_NAMES
  22. #define reference cmark_reference
  23. #define reference_map cmark_reference_map
  24. #define reference_map_new cmark_reference_map_new
  25. #define reference_map_free cmark_reference_map_free
  26. #define reference_lookup cmark_reference_lookup
  27. #define reference_create cmark_reference_create
  28. #endif
  29. #endif