From 06d7c8718c2f10c10c69ff457d4ab6f881c43154 Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Wed, 24 May 2017 10:35:31 -0400 Subject: [PATCH] CHANGED: Refactor CriticMarkup basic commands to be part of libMultiMarkdown.h --- .../include/libMultiMarkdown.h | 28 +++++++++++++++++++ Sources/multimarkdown/main.c | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Sources/libMultiMarkdown/include/libMultiMarkdown.h b/Sources/libMultiMarkdown/include/libMultiMarkdown.h index a4eaf0b..236760c 100644 --- a/Sources/libMultiMarkdown/include/libMultiMarkdown.h +++ b/Sources/libMultiMarkdown/include/libMultiMarkdown.h @@ -85,6 +85,10 @@ /// * `mmd_engine...` -- useful when you are processing the same source multiple times +/* + C string variants +*/ + /// Convert MMD text to specified format, with specified extensions, and language /// Returned char * must be freed char * mmd_string_convert(const char * source, unsigned long extensions, short format, short language); @@ -111,6 +115,10 @@ char * mmd_string_metavalue_for_key(char * source, const char * key); +/* + DString variants - DString ("dynamic string") is a mutable string implementation used in this project +*/ + /// Convert MMD text to specified format, with specified extensions, and language /// Returned char * must be freed char * mmd_d_string_convert(DString * source, unsigned long extensions, short format, short language); @@ -137,6 +145,10 @@ char * mmd_d_string_metavalue_for_key(DString * source, const char * key); +/* + MMD Engine variants +*/ + /// MMD Engine is used for storing configuration information for MMD parser typedef struct mmd_engine mmd_engine; @@ -206,6 +218,12 @@ char * mmd_engine_metadata_keys(mmd_engine * e); char * mmd_engine_metavalue_for_key(mmd_engine * e, const char * key); + + +/* + Utility functions +*/ + /// Return the version string for this build of libMultiMarkdown /// The returned `char *` will need to be freed after it is no longer needed. char * mmd_version(void); @@ -214,14 +232,24 @@ char * mmd_version(void); // Read file into memory DString * scan_file(const char * fname); + /// MMD Engine is used for storing configuration information for MMD parser typedef struct stack stack; + /// Recursively transclude source text, given a search directory. /// Track files to prevent infinite recursive loops void mmd_transclude_source(DString * source, const char * search_path, const char * source_path, short format, struct stack * parsed, struct stack * manifest); +/// Accept all CriticMarkup changes in the source string +void mmd_critic_markup_accept(DString * d); + + +/// Reject all CriticMarkup changes in the source string +void mmd_critic_markup_reject(DString * d); + + /// Token types for parse tree enum token_types { DOC_START_TOKEN = 0, //!< DOC_START_TOKEN must be type 0 diff --git a/Sources/multimarkdown/main.c b/Sources/multimarkdown/main.c index a7f030a..b279c5c 100644 --- a/Sources/multimarkdown/main.c +++ b/Sources/multimarkdown/main.c @@ -61,7 +61,6 @@ #include "argtable3.h" -#include "critic_markup.h" #include "d_string.h" #include "i18n.h" #include "libMultiMarkdown.h" -- 2.40.0