aboutsummaryrefslogtreecommitdiff
path: root/src/node.h
blob: 755274e1b8ea9d3e2136e42bbf4a041fa18e81cc (plain)
  1. #ifndef CMARK_NODE_H
  2. #define CMARK_NODE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "cmark.h"
  7. #include "buffer.h"
  8. #include "chunk.h"
  9. typedef struct {
  10. cmark_list_type list_type;
  11. int marker_offset;
  12. int padding;
  13. int start;
  14. cmark_delim_type delimiter;
  15. unsigned char bullet_char;
  16. bool tight;
  17. } cmark_list;
  18. typedef struct {
  19. int fence_length;
  20. int fence_offset;
  21. unsigned char fence_char;
  22. cmark_strbuf info;
  23. } cmark_fenced_code;
  24. typedef struct {
  25. int level;
  26. } cmark_header;
  27. typedef struct {
  28. struct cmark_node *label;
  29. unsigned char *url;
  30. unsigned char *title;
  31. } cmark_link;
  32. struct cmark_node {
  33. cmark_node_type type;
  34. struct cmark_node *next;
  35. struct cmark_node *prev;
  36. struct cmark_node *parent;
  37. struct cmark_node *first_child;
  38. struct cmark_node *last_child;
  39. int start_line;
  40. int start_column;
  41. int end_line;
  42. bool open;
  43. bool last_line_blank;
  44. cmark_strbuf string_content;
  45. union {
  46. cmark_chunk literal;
  47. cmark_list list;
  48. cmark_fenced_code code;
  49. cmark_header header;
  50. cmark_link link;
  51. } as;
  52. };
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif