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