]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: Adjust libMultiMarkdown.h so it does not recursively include other files
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 1 Nov 2017 19:13:17 +0000 (15:13 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 1 Nov 2017 19:13:17 +0000 (15:13 -0400)
Sources/libMultiMarkdown/include/d_string.h
Sources/libMultiMarkdown/include/libMultiMarkdown.h
Sources/libMultiMarkdown/include/token.h

index 787fb81d866ed83b1898f5d5b32b6e231e254cd1..ae9664d97d6c3a514bf8538c1ee0312cc4581464 100644 (file)
@@ -10,7 +10,7 @@
 
        @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
 );
 
 
index 7763f27f5c15c8dbf47cd735dc24934a4dd824b8..c2159badd82537c269519b6724fc045327a3d3aa 100644 (file)
@@ -8,7 +8,7 @@
 
 
        @author Fletcher T. Penney
-       @bug    
+       @bug
 
 
        ******IMPORTANT******
@@ -20,7 +20,7 @@
        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:
@@ -181,10 +193,6 @@ struct stack * mmd_d_string_transclusion_manifest(DString * source, const char *
        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,
@@ -206,8 +214,8 @@ void mmd_engine_reset(mmd_engine * e);
 
 /// Free an existing MMD Engine
 void mmd_engine_free(
-       mmd_engine * e,
-       bool freeDString
+       mmd_engine *    e,
+       bool                    freeDString
 );
 
 
@@ -281,10 +289,6 @@ char * mmd_version(void);
 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);
@@ -440,7 +444,7 @@ enum token_types {
        HTML_COMMENT_START,
        HTML_COMMENT_STOP,
        PAIR_HTML_COMMENT,
-       
+
        MATH_PAREN_OPEN,
        MATH_PAREN_CLOSE,
        MATH_BRACKET_OPEN,
@@ -452,7 +456,7 @@ enum token_types {
        PIPE,
        PLUS,
        SLASH,
-       
+
        SUPERSCRIPT,
        SUBSCRIPT,
 
@@ -481,7 +485,7 @@ enum token_types {
        TABLE_DIVIDER,
 
        TOC,
-       
+
        TEXT_BACKSLASH,
        RAW_FILTER_LEFT,
        TEXT_BRACE_LEFT,
index 1421bd6528b30de541f1fce1c0441babe79c0205..e8a80c0bae7c52027769a2fab302454631482cc6 100644 (file)
@@ -10,7 +10,7 @@
 
        @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