diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:41:54 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:41:54 +0300 |
| commit | 3d2121f5d6555744ce5aa502088fc2b34dc26d38 (patch) | |
| tree | 53f42c08746171878b57f5b6ffe1eb841da9d45d /cmark/src/node.h | |
| parent | 6bf7c5ce92ff6237c0b17c332873805018812b40 (diff) | |
| parent | 64efa3b3b3d35f2ffb604b57a8a9c89047cb420b (diff) | |
| download | Project-Tick-3d2121f5d6555744ce5aa502088fc2b34dc26d38.tar.gz Project-Tick-3d2121f5d6555744ce5aa502088fc2b34dc26d38.zip | |
Add 'cmark/' from commit '64efa3b3b3d35f2ffb604b57a8a9c89047cb420b'
git-subtree-dir: cmark
git-subtree-mainline: 6bf7c5ce92ff6237c0b17c332873805018812b40
git-subtree-split: 64efa3b3b3d35f2ffb604b57a8a9c89047cb420b
Diffstat (limited to 'cmark/src/node.h')
| -rw-r--r-- | cmark/src/node.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/cmark/src/node.h b/cmark/src/node.h new file mode 100644 index 0000000000..3d9ddcf54b --- /dev/null +++ b/cmark/src/node.h @@ -0,0 +1,93 @@ +#ifndef CMARK_NODE_H +#define CMARK_NODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> + +#include "cmark.h" +#include "buffer.h" + +typedef struct { + int marker_offset; + int padding; + int start; + unsigned char list_type; + unsigned char delimiter; + unsigned char bullet_char; + bool tight; +} cmark_list; + +typedef struct { + unsigned char *info; + uint8_t fence_length; + uint8_t fence_offset; + unsigned char fence_char; + int8_t fenced; +} cmark_code; + +typedef struct { + int internal_offset; + int8_t level; + bool setext; +} cmark_heading; + +typedef struct { + unsigned char *url; + unsigned char *title; +} cmark_link; + +typedef struct { + unsigned char *on_enter; + unsigned char *on_exit; +} cmark_custom; + +enum cmark_node__internal_flags { + CMARK_NODE__OPEN = (1 << 0), + CMARK_NODE__LAST_LINE_BLANK = (1 << 1), + CMARK_NODE__LAST_LINE_CHECKED = (1 << 2), + CMARK_NODE__LIST_LAST_LINE_BLANK = (1 << 3), +}; + +struct cmark_node { + cmark_mem *mem; + + struct cmark_node *next; + struct cmark_node *prev; + struct cmark_node *parent; + struct cmark_node *first_child; + struct cmark_node *last_child; + + void *user_data; + + unsigned char *data; + bufsize_t len; + + int start_line; + int start_column; + int end_line; + int end_column; + uint16_t type; + uint16_t flags; + + union { + cmark_list list; + cmark_code code; + cmark_heading heading; + cmark_link link; + cmark_custom custom; + int html_block_type; + } as; +}; + +CMARK_EXPORT int cmark_node_check(cmark_node *node, FILE *out); + +#ifdef __cplusplus +} +#endif + +#endif |
