@author Daniel Jalkut, modified by Fletcher T. Penney and Dan Lowe
- @bug
+ @bug
**/
The `MultiMarkdown 6` project is released under the MIT License..
-
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
-
+
https://github.com/fletcher/MultiMarkdown-4/
-
+
MMD 4 is released under both the MIT License and GPL.
-
-
+
+
CuTest is released under the zlib/libpng license. See CuTest.c for the text
of the license.
-
-
+
+
## The MIT License ##
-
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-
+
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#include <stdbool.h>
#include <stdlib.h>
-/* WE implement minimal mirror implementations of GLib's GString
+/* WE implement minimal mirror implementations of GLib's GString
* sufficient to cover the functionality required by MultiMarkdown.
*
- * NOTE: THese are 100% clean, from-scratch implementations using only the
+ * NOTE: THese are 100% clean, from-scratch implementations using only the
* GLib function prototype as guide for behavior.
*/
/// Structure for dynamic string
-typedef struct
-{
+struct DString {
char * str; //!< Pointer to UTF-8 byte stream for string
unsigned long currentStringBufferSize; //!< Size of buffer currently allocated
unsigned long currentStringLength; //!< Size of current string
-} DString;
+};
+
+typedef struct DString DString;
/// Create a new dynamic string
DString * d_string_new(
- const char * startingString //!< Initial contents for string
+ const char * startingString //!< Initial contents for string
);
@author Fletcher T. Penney
- @bug
+ @bug
******IMPORTANT******
2. Properly manage the `token_pool_init` and `token_pool_free` functions.
- I recommend option #1, unless you absolutely need the best performance for
+ I recommend option #1, unless you absolutely need the best performance for
long documents. Doing #2 properly is tricky in any program that can handle
multiple MMD text strings at overlapping times.
The `MultiMarkdown 6` project is released under the MIT License..
-
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
-
+
https://github.com/fletcher/MultiMarkdown-4/
-
+
MMD 4 is released under both the MIT License and GPL.
-
-
+
+
CuTest is released under the zlib/libpng license. See CuTest.c for the text
of the license.
-
-
+
+
## The MIT License ##
-
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-
+
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#include <stdlib.h>
-#include "d_string.h"
-#include "token.h"
+/// typedefs for internal data structures. If you intend to work with these structures
+/// in your own code, you may need to import additional header files.
+
+/// From token.h:
+typedef struct token token;
+
+/// From d_string.h:
+typedef struct DString DString;
+
+/// From mmd.h
+typedef struct mmd_engine mmd_engine;
+
+/// From stack.h
+typedef struct stack stack;
/// There are 3 main versions of the primary functions:
MMD Engine variants
*/
-/// MMD Engine is used for storing configuration information for MMD parser
-typedef struct mmd_engine mmd_engine;
-
-
/// Create MMD Engine using an existing DString (A new copy is *not* made)
mmd_engine * mmd_engine_create_with_dstring(
DString * d,
/// Free an existing MMD Engine
void mmd_engine_free(
- mmd_engine * e,
- bool freeDString
+ mmd_engine * e,
+ bool freeDString
);
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);
HTML_COMMENT_START,
HTML_COMMENT_STOP,
PAIR_HTML_COMMENT,
-
+
MATH_PAREN_OPEN,
MATH_PAREN_CLOSE,
MATH_BRACKET_OPEN,
PIPE,
PLUS,
SLASH,
-
+
SUPERSCRIPT,
SUBSCRIPT,
TABLE_DIVIDER,
TOC,
-
+
TEXT_BACKSLASH,
RAW_FILTER_LEFT,
TEXT_BRACE_LEFT,
@author Fletcher T. Penney
- @bug
+ @bug
**/
The `MultiMarkdown 6` project is released under the MIT License..
-
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
-
+
https://github.com/fletcher/MultiMarkdown-4/
-
+
MMD 4 is released under both the MIT License and GPL.
-
-
+
+
CuTest is released under the zlib/libpng license. See CuTest.c for the text
of the license.
-
-
+
+
## The MIT License ##
-
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-
+
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
#define kUseObjectPool 1 //!< Use an object pool to allocate tokens to improve
- //!< performance in memory allocation. Frees all
- //!< tokens at once, however, at end of parsing.
+//!< performance in memory allocation. Frees all
+//!< tokens at once, however, at end of parsing.
/// Should call init() once per thread/use, and drain() once per thread/use.
/// This allows us to know when the pool is no longer being used and it is safe
/// to free.
#ifdef kUseObjectPool
-void token_pool_init(void); //!< Initialize object pool for allocating tokens
-void token_pool_drain(void); //!< Drain pool to free memory when parse complete
-void token_pool_free(void); //!< Free the token object pool
+ void token_pool_init(void); //!< Initialize object pool for allocating tokens
+ void token_pool_drain(void); //!< Drain pool to free memory when parse complete
+ void token_pool_free(void); //!< Free the token object pool
#endif