Initial commit.

This commit is contained in:
Joshua Bemenderfer
2022-08-31 22:15:07 -04:00
commit 9b5ac14082
11 changed files with 4401 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
struct terrace_linedata_s {
char type;
unsigned int level;
};
typedef struct terrace_linedata_s terrace_linedata_t;
void terrace_parse_line(char* line, terrace_linedata_t *lineData) {
char type = 0;
unsigned int level = 0;
if (line[0] == '\n') {
if (lineData->type == 1) level++;
if (lineData->type == 0) level = lineData->level;
} else {
type = 1;
while(line[level] == ' ' && level <= lineData->level + 1) ++level;
}
lineData->type = type;
lineData->level = level;
}