#ifndef MD_TABLE_STATS_H #define MD_TABLE_STATS_H #include "sashidown.h" #include #include #define SASHIDOWN_MAX_COLS 32 /* * [CST Pending Window Metadata] — lightweight table descriptor for the * delayed-commitment pending window. Records header/separator/body bounds * without caching cells; render rescans once after the separator enters * the confirmation frontier. No per-cell heap; O(1) registers only. */ typedef struct { size_t start; /* header line start */ size_t end; /* first byte after the table */ size_t body_start; /* first body row (after separator) */ int cols; /* column count from header (GFM) */ int body_rows; int valid; } table_entry_t; int table_is_separator_row(const char *line, size_t len); int table_count_cols(const char *line, size_t len, int *has_pipe); /* ctx may be NULL (falls back to memchr); when non-NULL reuses line_index. */ int table_try_parse_at(sashidown_ctx_t *ctx, const char *input, size_t len, size_t pos, table_entry_t *e); #endif /* MD_TABLE_STATS_H */