aboutsummaryrefslogtreecommitdiff
path: root/src/references.h
blob: 58658b6cad5e9b2b5c8b5555a13548f0ee47ab84 (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, chunk *label);
  23. extern void cmark_reference_create(cmark_reference_map *map, chunk *label, chunk *url, chunk *title);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif