aboutsummaryrefslogtreecommitdiff
path: root/src/references.h
blob: 69325bbd896949438592d0f7600d7f72c37b74b0 (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. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif