├── .gitignore ├── COPYING ├── Makefile.am ├── README.md ├── autogen.sh ├── configure.ac ├── doc ├── Doxyfile ├── footer.html └── intro.dox ├── examples ├── Makefile.am ├── array.c ├── array.template ├── simple.c └── simple.template ├── mustache_c-1.0.pc.in ├── src ├── Makefile.am ├── mustache-internal.h ├── mustache.c ├── mustache.h ├── parser.l └── parser.y └── test ├── Makefile.am └── test.c /.gitignore: -------------------------------------------------------------------------------- 1 | .deps 2 | .dirstamp 3 | *.sw[po] 4 | *.lo 5 | *.o 6 | *.la 7 | *.dat 8 | *.so 9 | Makefile 10 | .libs 11 | stamp-h1 12 | autom4te.cache/* 13 | config.log 14 | config.status 15 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | pkgconfigdir = $(libdir)/pkgconfig 2 | pkgconfig_DATA = mustache_c-1.0.pc 3 | 4 | SUBDIRS = src . test examples 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | mustache-c is a basic implementation of mustache templating in pure C. 4 | 5 | # Features 6 | 7 | Supported: 8 | 9 | * Sleek pure C API 10 | * Prerendering for better speed 11 | * Sections and variables 12 | 13 | Not supported: 14 | 15 | * Partials 16 | * HTML escaping 17 | * Custom delimiters 18 | 19 | # Installation 20 | 21 | Simply use the ```configure``` script to compile and install mustache-c: 22 | 23 | ```shell 24 | $ ./configure --prefix=/usr 25 | $ make 26 | $ sudo make install 27 | ``` 28 | 29 | mustache-c requires ```flex```, ```bison``` and reasonable modern C 30 | library that provides ```stdint.h```. If you wish to build the doxygen 31 | documentation you will also need ```doxygen```. 32 | 33 | mustache-c provides a ```pkg-config``` file with which you can determine 34 | libraries and include paths: 35 | 36 | ```shell 37 | $ pkg-config --libs mustache_c-1.0 38 | $ pkg-config --cflags mustache_c-1.0 39 | ``` 40 | 41 | This also allows mustache-c to be picked up by ```cmake```: 42 | 43 | ```cmake 44 | FIND_PACKAGE(PkgConfig) 45 | PKG_CHECK_MODULES(MUSTACHEC REQUIRED mustache_c-1.0) 46 | ``` 47 | 48 | # Usage 49 | 50 | There is a [test](https://github.com/x86-64/mustache-c/blob/master/test/test.c) 51 | program available in the source which shows the basic usage of mustache-c. 52 | 53 | # API Documentation 54 | 55 | See [this link](http://x86-64.github.com/mustache-c/) for the Doxygen 56 | documentation of the API. 57 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | test -n "$srcdir" || srcdir=`dirname "$0"` 4 | test -n "$srcdir" || srcdir=. 5 | olddir=`pwd` 6 | 7 | cd $srcdir 8 | test -f configure.ac || { 9 | echo "You must run this script in the top-level checkout directory" 10 | exit 1 11 | } 12 | 13 | # NOCONFIGURE is used by gnome-common 14 | if test -z "$NOCONFIGURE"; then 15 | echo "This script will run ./configure automatically. If you wish to pass " 16 | echo "any arguments to it, please specify them on the $0 " 17 | echo "command line. To disable this behavior, have NOCONFIGURE=1 in your " 18 | echo "environment." 19 | fi 20 | 21 | # Run the actual tools to prepare the clean checkout 22 | autoreconf -fi || exit $? 23 | 24 | cd "$olddir" 25 | test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" 26 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.61) 2 | AC_INIT([mustache_c], [1.0.0], [x86mail@gmail.com]) 3 | 4 | AC_CONFIG_FILES([mustache_c-1.0.pc]) 5 | AC_CONFIG_HEADERS([config.h]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | AC_CONFIG_AUX_DIR([build]) 8 | 9 | AM_INIT_AUTOMAKE([foreign 1.11 parallel-tests tar-ustar subdir-objects]) 10 | 11 | AC_PROG_CC 12 | AC_PROG_LIBTOOL 13 | AC_HEADER_STDC 14 | AC_FUNC_MALLOC 15 | 16 | PKG_PROG_PKG_CONFIG 17 | PKG_INSTALLDIR 18 | 19 | AC_PATH_PROGS(BISON, [bison], no) 20 | AC_PATH_PROGS(FLEX, [flex], no) 21 | 22 | AC_CHECK_HEADER([stdint.h], [], 23 | [AC_MSG_ERROR([Couldn't find or include stdint.h])], 24 | []) 25 | 26 | AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [compile with debug functions])) 27 | if test "x$enable_debug" == "xyes"; then 28 | AC_DEFINE([DEBUG], [1], [Defined if debug functions requested]) 29 | fi 30 | 31 | AC_ARG_ENABLE(helpers, AS_HELP_STRING([--disable-helpers], [do not include helper functions ])) 32 | if test "x$enable_helpers" != "xyes"; then 33 | AC_DEFINE([HELPERS], [1], [Define if helpers routines enabled]) 34 | fi 35 | 36 | AS_IF([test x"$BISON" == xno || test x"$FLEX" == xno], [ 37 | AC_MSG_ERROR([bison and flex need to be installed to build mustache-c]) 38 | ], []) 39 | 40 | AC_CONFIG_FILES([Makefile 41 | src/Makefile 42 | test/Makefile 43 | examples/Makefile 44 | ]) 45 | AC_OUTPUT 46 | -------------------------------------------------------------------------------- /doc/Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.5.8 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project 5 | # 6 | # All text after a hash (#) is considered a comment and will be ignored 7 | # The format is: 8 | # TAG = value [value, ...] 9 | # For lists items can also be appended using: 10 | # TAG += value [value, ...] 11 | # Values that contain spaces should be placed between quotes (" ") 12 | 13 | #--------------------------------------------------------------------------- 14 | # Project related configuration options 15 | #--------------------------------------------------------------------------- 16 | 17 | # This tag specifies the encoding used for all characters in the config file 18 | # that follow. The default is UTF-8 which is also the encoding used for all 19 | # text before the first occurrence of this tag. Doxygen uses libiconv (or the 20 | # iconv built into libc) for the transcoding. See 21 | # http://www.gnu.org/software/libiconv for the list of possible encodings. 22 | 23 | DOXYFILE_ENCODING = UTF-8 24 | 25 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 26 | # by quotes) that should identify the project. 27 | 28 | PROJECT_NAME = mustache-c 29 | 30 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. 31 | # This could be handy for archiving the generated documentation or 32 | # if some version control system is used. 33 | 34 | PROJECT_NUMBER = 1.0 35 | 36 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 37 | # base path where the generated documentation will be put. 38 | # If a relative path is entered, it will be relative to the location 39 | # where doxygen was started. If left blank the current directory will be used. 40 | 41 | OUTPUT_DIRECTORY = ../ 42 | 43 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 44 | # 4096 sub-directories (in 2 levels) under the output directory of each output 45 | # format and will distribute the generated files over these directories. 46 | # Enabling this option can be useful when feeding doxygen a huge amount of 47 | # source files, where putting all generated files in the same directory would 48 | # otherwise cause performance problems for the file system. 49 | 50 | CREATE_SUBDIRS = NO 51 | 52 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 53 | # documentation generated by doxygen is written. Doxygen will use this 54 | # information to generate all constant output in the proper language. 55 | # The default language is English, other supported languages are: 56 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 57 | # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, 58 | # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), 59 | # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, 60 | # Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, 61 | # Spanish, Swedish, and Ukrainian. 62 | 63 | OUTPUT_LANGUAGE = English 64 | 65 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 66 | # include brief member descriptions after the members that are listed in 67 | # the file and class documentation (similar to JavaDoc). 68 | # Set to NO to disable this. 69 | 70 | BRIEF_MEMBER_DESC = YES 71 | 72 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 73 | # the brief description of a member or function before the detailed description. 74 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 75 | # brief descriptions will be completely suppressed. 76 | 77 | REPEAT_BRIEF = YES 78 | 79 | # This tag implements a quasi-intelligent brief description abbreviator 80 | # that is used to form the text in various listings. Each string 81 | # in this list, if found as the leading text of the brief description, will be 82 | # stripped from the text and the result after processing the whole list, is 83 | # used as the annotated text. Otherwise, the brief description is used as-is. 84 | # If left blank, the following values are used ("$name" is automatically 85 | # replaced with the name of the entity): "The $name class" "The $name widget" 86 | # "The $name file" "is" "provides" "specifies" "contains" 87 | # "represents" "a" "an" "the" 88 | 89 | ABBREVIATE_BRIEF = "The $name class" \ 90 | "The $name widget" \ 91 | "The $name file" \ 92 | is \ 93 | provides \ 94 | specifies \ 95 | contains \ 96 | represents \ 97 | a \ 98 | an \ 99 | the 100 | 101 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 102 | # Doxygen will generate a detailed section even if there is only a brief 103 | # description. 104 | 105 | ALWAYS_DETAILED_SEC = NO 106 | 107 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 108 | # inherited members of a class in the documentation of that class as if those 109 | # members were ordinary class members. Constructors, destructors and assignment 110 | # operators of the base classes will not be shown. 111 | 112 | INLINE_INHERITED_MEMB = NO 113 | 114 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 115 | # path before files name in the file list and in the header files. If set 116 | # to NO the shortest path that makes the file name unique will be used. 117 | 118 | FULL_PATH_NAMES = NO 119 | 120 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 121 | # can be used to strip a user-defined part of the path. Stripping is 122 | # only done if one of the specified strings matches the left-hand part of 123 | # the path. The tag can be used to show relative paths in the file list. 124 | # If left blank the directory from which doxygen is run is used as the 125 | # path to strip. 126 | 127 | STRIP_FROM_PATH = / 128 | 129 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 130 | # the path mentioned in the documentation of a class, which tells 131 | # the reader which header file to include in order to use a class. 132 | # If left blank only the name of the header file containing the class 133 | # definition is used. Otherwise one should specify the include paths that 134 | # are normally passed to the compiler using the -I flag. 135 | 136 | STRIP_FROM_INC_PATH = 137 | 138 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 139 | # (but less readable) file names. This can be useful is your file systems 140 | # doesn't support long names like on DOS, Mac, or CD-ROM. 141 | 142 | SHORT_NAMES = NO 143 | 144 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 145 | # will interpret the first line (until the first dot) of a JavaDoc-style 146 | # comment as the brief description. If set to NO, the JavaDoc 147 | # comments will behave just like regular Qt-style comments 148 | # (thus requiring an explicit @brief command for a brief description.) 149 | 150 | JAVADOC_AUTOBRIEF = NO 151 | 152 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 153 | # interpret the first line (until the first dot) of a Qt-style 154 | # comment as the brief description. If set to NO, the comments 155 | # will behave just like regular Qt-style comments (thus requiring 156 | # an explicit \brief command for a brief description.) 157 | 158 | QT_AUTOBRIEF = NO 159 | 160 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 161 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 162 | # comments) as a brief description. This used to be the default behaviour. 163 | # The new default is to treat a multi-line C++ comment block as a detailed 164 | # description. Set this tag to YES if you prefer the old behaviour instead. 165 | 166 | MULTILINE_CPP_IS_BRIEF = NO 167 | 168 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 169 | # member inherits the documentation from any documented member that it 170 | # re-implements. 171 | 172 | INHERIT_DOCS = YES 173 | 174 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 175 | # a new page for each member. If set to NO, the documentation of a member will 176 | # be part of the file/class/namespace that contains it. 177 | 178 | SEPARATE_MEMBER_PAGES = NO 179 | 180 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 181 | # Doxygen uses this value to replace tabs by spaces in code fragments. 182 | 183 | TAB_SIZE = 8 184 | 185 | # This tag can be used to specify a number of aliases that acts 186 | # as commands in the documentation. An alias has the form "name=value". 187 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 188 | # put the command \sideeffect (or @sideeffect) in the documentation, which 189 | # will result in a user-defined paragraph with heading "Side Effects:". 190 | # You can put \n's in the value part of an alias to insert newlines. 191 | 192 | ALIASES = 193 | 194 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 195 | # sources only. Doxygen will then generate output that is more tailored for C. 196 | # For instance, some of the names that are used will be different. The list 197 | # of all members will be omitted, etc. 198 | 199 | OPTIMIZE_OUTPUT_FOR_C = YES 200 | 201 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 202 | # sources only. Doxygen will then generate output that is more tailored for 203 | # Java. For instance, namespaces will be presented as packages, qualified 204 | # scopes will look different, etc. 205 | 206 | OPTIMIZE_OUTPUT_JAVA = NO 207 | 208 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 209 | # sources only. Doxygen will then generate output that is more tailored for 210 | # Fortran. 211 | 212 | OPTIMIZE_FOR_FORTRAN = NO 213 | 214 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 215 | # sources. Doxygen will then generate output that is tailored for 216 | # VHDL. 217 | 218 | OPTIMIZE_OUTPUT_VHDL = NO 219 | 220 | # Doxygen selects the parser to use depending on the extension of the files it parses. 221 | # With this tag you can assign which parser to use for a given extension. 222 | # Doxygen has a built-in mapping, but you can override or extend it using this tag. 223 | # The format is ext=language, where ext is a file extension, and language is one of 224 | # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 225 | # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 226 | # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 227 | # use: inc=Fortran f=C 228 | 229 | EXTENSION_MAPPING = 230 | 231 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 232 | # to include (a tag file for) the STL sources as input, then you should 233 | # set this tag to YES in order to let doxygen match functions declarations and 234 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 235 | # func(std::string) {}). This also make the inheritance and collaboration 236 | # diagrams that involve STL classes more complete and accurate. 237 | 238 | BUILTIN_STL_SUPPORT = NO 239 | 240 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 241 | # enable parsing support. 242 | 243 | CPP_CLI_SUPPORT = NO 244 | 245 | # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 246 | # Doxygen will parse them like normal C++ but will assume all classes use public 247 | # instead of private inheritance when no explicit protection keyword is present. 248 | 249 | SIP_SUPPORT = NO 250 | 251 | # For Microsoft's IDL there are propget and propput attributes to indicate getter 252 | # and setter methods for a property. Setting this option to YES (the default) 253 | # will make doxygen to replace the get and set methods by a property in the 254 | # documentation. This will only work if the methods are indeed getting or 255 | # setting a simple type. If this is not the case, or you want to show the 256 | # methods anyway, you should set this option to NO. 257 | 258 | IDL_PROPERTY_SUPPORT = YES 259 | 260 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 261 | # tag is set to YES, then doxygen will reuse the documentation of the first 262 | # member in the group (if any) for the other members of the group. By default 263 | # all members of a group must be documented explicitly. 264 | 265 | DISTRIBUTE_GROUP_DOC = NO 266 | 267 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 268 | # the same type (for instance a group of public functions) to be put as a 269 | # subgroup of that type (e.g. under the Public Functions section). Set it to 270 | # NO to prevent subgrouping. Alternatively, this can be done per class using 271 | # the \nosubgrouping command. 272 | 273 | SUBGROUPING = YES 274 | 275 | # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 276 | # is documented as struct, union, or enum with the name of the typedef. So 277 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 278 | # with name TypeT. When disabled the typedef will appear as a member of a file, 279 | # namespace, or class. And the struct will be named TypeS. This can typically 280 | # be useful for C code in case the coding convention dictates that all compound 281 | # types are typedef'ed and only the typedef is referenced, never the tag name. 282 | 283 | TYPEDEF_HIDES_STRUCT = NO 284 | 285 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 286 | # determine which symbols to keep in memory and which to flush to disk. 287 | # When the cache is full, less often used symbols will be written to disk. 288 | # For small to medium size projects (<1000 input files) the default value is 289 | # probably good enough. For larger projects a too small cache size can cause 290 | # doxygen to be busy swapping symbols to and from disk most of the time 291 | # causing a significant performance penality. 292 | # If the system has enough physical memory increasing the cache will improve the 293 | # performance by keeping more symbols in memory. Note that the value works on 294 | # a logarithmic scale so increasing the size by one will rougly double the 295 | # memory usage. The cache size is given by this formula: 296 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 297 | # corresponding to a cache size of 2^16 = 65536 symbols 298 | 299 | SYMBOL_CACHE_SIZE = 0 300 | 301 | #--------------------------------------------------------------------------- 302 | # Build related configuration options 303 | #--------------------------------------------------------------------------- 304 | 305 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 306 | # documentation are documented, even if no documentation was available. 307 | # Private class members and static file members will be hidden unless 308 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 309 | 310 | EXTRACT_ALL = NO 311 | 312 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 313 | # will be included in the documentation. 314 | 315 | EXTRACT_PRIVATE = NO 316 | 317 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 318 | # will be included in the documentation. 319 | 320 | EXTRACT_STATIC = NO 321 | 322 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 323 | # defined locally in source files will be included in the documentation. 324 | # If set to NO only classes defined in header files are included. 325 | 326 | EXTRACT_LOCAL_CLASSES = YES 327 | 328 | # This flag is only useful for Objective-C code. When set to YES local 329 | # methods, which are defined in the implementation section but not in 330 | # the interface are included in the documentation. 331 | # If set to NO (the default) only methods in the interface are included. 332 | 333 | EXTRACT_LOCAL_METHODS = NO 334 | 335 | # If this flag is set to YES, the members of anonymous namespaces will be 336 | # extracted and appear in the documentation as a namespace called 337 | # 'anonymous_namespace{file}', where file will be replaced with the base 338 | # name of the file that contains the anonymous namespace. By default 339 | # anonymous namespace are hidden. 340 | 341 | EXTRACT_ANON_NSPACES = NO 342 | 343 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 344 | # undocumented members of documented classes, files or namespaces. 345 | # If set to NO (the default) these members will be included in the 346 | # various overviews, but no documentation section is generated. 347 | # This option has no effect if EXTRACT_ALL is enabled. 348 | 349 | HIDE_UNDOC_MEMBERS = NO 350 | 351 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 352 | # undocumented classes that are normally visible in the class hierarchy. 353 | # If set to NO (the default) these classes will be included in the various 354 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 355 | 356 | HIDE_UNDOC_CLASSES = NO 357 | 358 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 359 | # friend (class|struct|union) declarations. 360 | # If set to NO (the default) these declarations will be included in the 361 | # documentation. 362 | 363 | HIDE_FRIEND_COMPOUNDS = NO 364 | 365 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 366 | # documentation blocks found inside the body of a function. 367 | # If set to NO (the default) these blocks will be appended to the 368 | # function's detailed documentation block. 369 | 370 | HIDE_IN_BODY_DOCS = NO 371 | 372 | # The INTERNAL_DOCS tag determines if documentation 373 | # that is typed after a \internal command is included. If the tag is set 374 | # to NO (the default) then the documentation will be excluded. 375 | # Set it to YES to include the internal documentation. 376 | 377 | INTERNAL_DOCS = NO 378 | 379 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 380 | # file names in lower-case letters. If set to YES upper-case letters are also 381 | # allowed. This is useful if you have classes or files whose names only differ 382 | # in case and if your file system supports case sensitive file names. Windows 383 | # and Mac users are advised to set this option to NO. 384 | 385 | CASE_SENSE_NAMES = NO 386 | 387 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 388 | # will show members with their full class and namespace scopes in the 389 | # documentation. If set to YES the scope will be hidden. 390 | 391 | HIDE_SCOPE_NAMES = YES 392 | 393 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 394 | # will put a list of the files that are included by a file in the documentation 395 | # of that file. 396 | 397 | SHOW_INCLUDE_FILES = YES 398 | 399 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 400 | # is inserted in the documentation for inline members. 401 | 402 | INLINE_INFO = YES 403 | 404 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 405 | # will sort the (detailed) documentation of file and class members 406 | # alphabetically by member name. If set to NO the members will appear in 407 | # declaration order. 408 | 409 | SORT_MEMBER_DOCS = YES 410 | 411 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 412 | # brief documentation of file, namespace and class members alphabetically 413 | # by member name. If set to NO (the default) the members will appear in 414 | # declaration order. 415 | 416 | SORT_BRIEF_DOCS = NO 417 | 418 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 419 | # hierarchy of group names into alphabetical order. If set to NO (the default) 420 | # the group names will appear in their defined order. 421 | 422 | SORT_GROUP_NAMES = NO 423 | 424 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 425 | # sorted by fully-qualified names, including namespaces. If set to 426 | # NO (the default), the class list will be sorted only by class name, 427 | # not including the namespace part. 428 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 429 | # Note: This option applies only to the class list, not to the 430 | # alphabetical list. 431 | 432 | SORT_BY_SCOPE_NAME = NO 433 | 434 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 435 | # disable (NO) the todo list. This list is created by putting \todo 436 | # commands in the documentation. 437 | 438 | GENERATE_TODOLIST = YES 439 | 440 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 441 | # disable (NO) the test list. This list is created by putting \test 442 | # commands in the documentation. 443 | 444 | GENERATE_TESTLIST = YES 445 | 446 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 447 | # disable (NO) the bug list. This list is created by putting \bug 448 | # commands in the documentation. 449 | 450 | GENERATE_BUGLIST = YES 451 | 452 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 453 | # disable (NO) the deprecated list. This list is created by putting 454 | # \deprecated commands in the documentation. 455 | 456 | GENERATE_DEPRECATEDLIST= YES 457 | 458 | # The ENABLED_SECTIONS tag can be used to enable conditional 459 | # documentation sections, marked by \if sectionname ... \endif. 460 | 461 | ENABLED_SECTIONS = 462 | 463 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 464 | # the initial value of a variable or define consists of for it to appear in 465 | # the documentation. If the initializer consists of more lines than specified 466 | # here it will be hidden. Use a value of 0 to hide initializers completely. 467 | # The appearance of the initializer of individual variables and defines in the 468 | # documentation can be controlled using \showinitializer or \hideinitializer 469 | # command in the documentation regardless of this setting. 470 | 471 | MAX_INITIALIZER_LINES = 30 472 | 473 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 474 | # at the bottom of the documentation of classes and structs. If set to YES the 475 | # list will mention the files that were used to generate the documentation. 476 | 477 | SHOW_USED_FILES = YES 478 | 479 | # If the sources in your project are distributed over multiple directories 480 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 481 | # in the documentation. The default is NO. 482 | 483 | SHOW_DIRECTORIES = NO 484 | 485 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 486 | # This will remove the Files entry from the Quick Index and from the 487 | # Folder Tree View (if specified). The default is YES. 488 | 489 | SHOW_FILES = YES 490 | 491 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the 492 | # Namespaces page. This will remove the Namespaces entry from the Quick Index 493 | # and from the Folder Tree View (if specified). The default is YES. 494 | 495 | SHOW_NAMESPACES = YES 496 | 497 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 498 | # doxygen should invoke to get the current version for each file (typically from 499 | # the version control system). Doxygen will invoke the program by executing (via 500 | # popen()) the command , where is the value of 501 | # the FILE_VERSION_FILTER tag, and is the name of an input file 502 | # provided by doxygen. Whatever the program writes to standard output 503 | # is used as the file version. See the manual for examples. 504 | 505 | FILE_VERSION_FILTER = 506 | 507 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 508 | # doxygen. The layout file controls the global structure of the generated output files 509 | # in an output format independent way. The create the layout file that represents 510 | # doxygen's defaults, run doxygen with the -l option. You can optionally specify a 511 | # file name after the option, if omitted DoxygenLayout.xml will be used as the name 512 | # of the layout file. 513 | 514 | LAYOUT_FILE = 515 | 516 | #--------------------------------------------------------------------------- 517 | # configuration options related to warning and progress messages 518 | #--------------------------------------------------------------------------- 519 | 520 | # The QUIET tag can be used to turn on/off the messages that are generated 521 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 522 | 523 | QUIET = NO 524 | 525 | # The WARNINGS tag can be used to turn on/off the warning messages that are 526 | # generated by doxygen. Possible values are YES and NO. If left blank 527 | # NO is used. 528 | 529 | WARNINGS = YES 530 | 531 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 532 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 533 | # automatically be disabled. 534 | 535 | WARN_IF_UNDOCUMENTED = YES 536 | 537 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 538 | # potential errors in the documentation, such as not documenting some 539 | # parameters in a documented function, or documenting parameters that 540 | # don't exist or using markup commands wrongly. 541 | 542 | WARN_IF_DOC_ERROR = YES 543 | 544 | # This WARN_NO_PARAMDOC option can be abled to get warnings for 545 | # functions that are documented, but have no documentation for their parameters 546 | # or return value. If set to NO (the default) doxygen will only warn about 547 | # wrong or incomplete parameter documentation, but not about the absence of 548 | # documentation. 549 | 550 | WARN_NO_PARAMDOC = NO 551 | 552 | # The WARN_FORMAT tag determines the format of the warning messages that 553 | # doxygen can produce. The string should contain the $file, $line, and $text 554 | # tags, which will be replaced by the file and line number from which the 555 | # warning originated and the warning text. Optionally the format may contain 556 | # $version, which will be replaced by the version of the file (if it could 557 | # be obtained via FILE_VERSION_FILTER) 558 | 559 | WARN_FORMAT = "$file:$line: $text" 560 | 561 | # The WARN_LOGFILE tag can be used to specify a file to which warning 562 | # and error messages should be written. If left blank the output is written 563 | # to stderr. 564 | 565 | WARN_LOGFILE = 566 | 567 | #--------------------------------------------------------------------------- 568 | # configuration options related to the input files 569 | #--------------------------------------------------------------------------- 570 | 571 | # The INPUT tag can be used to specify the files and/or directories that contain 572 | # documented source files. You may enter file names like "myfile.cpp" or 573 | # directories like "/usr/src/myproject". Separate the files or directories 574 | # with spaces. 575 | 576 | INPUT = . 577 | 578 | # This tag can be used to specify the character encoding of the source files 579 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 580 | # also the default input encoding. Doxygen uses libiconv (or the iconv built 581 | # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 582 | # the list of possible encodings. 583 | 584 | INPUT_ENCODING = UTF-8 585 | 586 | # If the value of the INPUT tag contains directories, you can use the 587 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 588 | # and *.h) to filter out the source-files in the directories. If left 589 | # blank the following patterns are tested: 590 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 591 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 592 | 593 | FILE_PATTERNS = *.c \ 594 | *.cc \ 595 | *.cxx \ 596 | *.cpp \ 597 | *.c++ \ 598 | *.d \ 599 | *.java \ 600 | *.ii \ 601 | *.ixx \ 602 | *.ipp \ 603 | *.i++ \ 604 | *.inl \ 605 | *.h \ 606 | *.hh \ 607 | *.hxx \ 608 | *.hpp \ 609 | *.h++ \ 610 | *.idl \ 611 | *.odl \ 612 | *.cs \ 613 | *.php \ 614 | *.php3 \ 615 | *.inc \ 616 | *.m \ 617 | *.mm \ 618 | *.dox \ 619 | *.py \ 620 | *.f90 \ 621 | *.f \ 622 | *.vhd \ 623 | *.vhdl 624 | 625 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 626 | # should be searched for input files as well. Possible values are YES and NO. 627 | # If left blank NO is used. 628 | 629 | RECURSIVE = YES 630 | 631 | # The EXCLUDE tag can be used to specify files and/or directories that should 632 | # excluded from the INPUT source files. This way you can easily exclude a 633 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 634 | 635 | EXCLUDE = test/test.c config.h 636 | 637 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 638 | # directories that are symbolic links (a Unix filesystem feature) are excluded 639 | # from the input. 640 | 641 | EXCLUDE_SYMLINKS = NO 642 | 643 | # If the value of the INPUT tag contains directories, you can use the 644 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 645 | # certain files from those directories. Note that the wildcards are matched 646 | # against the file with absolute path, so to exclude all test directories 647 | # for example use the pattern */test/* 648 | 649 | EXCLUDE_PATTERNS = .git .deps .libs *.cache m4 *.tab.c *.tab.h *.lex.c 650 | 651 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 652 | # (namespaces, classes, functions, etc.) that should be excluded from the 653 | # output. The symbol name can be a fully qualified name, a word, or if the 654 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 655 | # AClass::ANamespace, ANamespace::*Test 656 | 657 | EXCLUDE_SYMBOLS = 658 | 659 | # The EXAMPLE_PATH tag can be used to specify one or more files or 660 | # directories that contain example code fragments that are included (see 661 | # the \include command). 662 | 663 | EXAMPLE_PATH = 664 | 665 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 666 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 667 | # and *.h) to filter out the source-files in the directories. If left 668 | # blank all files are included. 669 | 670 | EXAMPLE_PATTERNS = * 671 | 672 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 673 | # searched for input files to be used with the \include or \dontinclude 674 | # commands irrespective of the value of the RECURSIVE tag. 675 | # Possible values are YES and NO. If left blank NO is used. 676 | 677 | EXAMPLE_RECURSIVE = NO 678 | 679 | # The IMAGE_PATH tag can be used to specify one or more files or 680 | # directories that contain image that are included in the documentation (see 681 | # the \image command). 682 | 683 | IMAGE_PATH = 684 | 685 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 686 | # invoke to filter for each input file. Doxygen will invoke the filter program 687 | # by executing (via popen()) the command , where 688 | # is the value of the INPUT_FILTER tag, and is the name of an 689 | # input file. Doxygen will then use the output that the filter program writes 690 | # to standard output. If FILTER_PATTERNS is specified, this tag will be 691 | # ignored. 692 | 693 | INPUT_FILTER = 694 | 695 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 696 | # basis. Doxygen will compare the file name with each pattern and apply the 697 | # filter if there is a match. The filters are a list of the form: 698 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 699 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 700 | # is applied to all files. 701 | 702 | FILTER_PATTERNS = 703 | 704 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 705 | # INPUT_FILTER) will be used to filter the input files when producing source 706 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 707 | 708 | FILTER_SOURCE_FILES = NO 709 | 710 | #--------------------------------------------------------------------------- 711 | # configuration options related to source browsing 712 | #--------------------------------------------------------------------------- 713 | 714 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 715 | # be generated. Documented entities will be cross-referenced with these sources. 716 | # Note: To get rid of all source code in the generated output, make sure also 717 | # VERBATIM_HEADERS is set to NO. 718 | 719 | SOURCE_BROWSER = NO 720 | 721 | # Setting the INLINE_SOURCES tag to YES will include the body 722 | # of functions and classes directly in the documentation. 723 | 724 | INLINE_SOURCES = NO 725 | 726 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 727 | # doxygen to hide any special comment blocks from generated source code 728 | # fragments. Normal C and C++ comments will always remain visible. 729 | 730 | STRIP_CODE_COMMENTS = YES 731 | 732 | # If the REFERENCED_BY_RELATION tag is set to YES 733 | # then for each documented function all documented 734 | # functions referencing it will be listed. 735 | 736 | REFERENCED_BY_RELATION = NO 737 | 738 | # If the REFERENCES_RELATION tag is set to YES 739 | # then for each documented function all documented entities 740 | # called/used by that function will be listed. 741 | 742 | REFERENCES_RELATION = NO 743 | 744 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 745 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 746 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 747 | # link to the source code. Otherwise they will link to the documentation. 748 | 749 | REFERENCES_LINK_SOURCE = YES 750 | 751 | # If the USE_HTAGS tag is set to YES then the references to source code 752 | # will point to the HTML generated by the htags(1) tool instead of doxygen 753 | # built-in source browser. The htags tool is part of GNU's global source 754 | # tagging system (see http://www.gnu.org/software/global/global.html). You 755 | # will need version 4.8.6 or higher. 756 | 757 | USE_HTAGS = NO 758 | 759 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 760 | # will generate a verbatim copy of the header file for each class for 761 | # which an include is specified. Set to NO to disable this. 762 | 763 | VERBATIM_HEADERS = YES 764 | 765 | #--------------------------------------------------------------------------- 766 | # configuration options related to the alphabetical class index 767 | #--------------------------------------------------------------------------- 768 | 769 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 770 | # of all compounds will be generated. Enable this if the project 771 | # contains a lot of classes, structs, unions or interfaces. 772 | 773 | ALPHABETICAL_INDEX = NO 774 | 775 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 776 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 777 | # in which this list will be split (can be a number in the range [1..20]) 778 | 779 | COLS_IN_ALPHA_INDEX = 5 780 | 781 | # In case all classes in a project start with a common prefix, all 782 | # classes will be put under the same header in the alphabetical index. 783 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 784 | # should be ignored while generating the index headers. 785 | 786 | IGNORE_PREFIX = 787 | 788 | #--------------------------------------------------------------------------- 789 | # configuration options related to the HTML output 790 | #--------------------------------------------------------------------------- 791 | 792 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 793 | # generate HTML output. 794 | 795 | GENERATE_HTML = YES 796 | 797 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 798 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 799 | # put in front of it. If left blank `html' will be used as the default path. 800 | 801 | HTML_OUTPUT = mustache-c-doc 802 | 803 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 804 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 805 | # doxygen will generate files with .html extension. 806 | 807 | HTML_FILE_EXTENSION = .html 808 | 809 | # The HTML_HEADER tag can be used to specify a personal HTML header for 810 | # each generated HTML page. If it is left blank doxygen will generate a 811 | # standard header. 812 | 813 | HTML_HEADER = 814 | 815 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 816 | # each generated HTML page. If it is left blank doxygen will generate a 817 | # standard footer. 818 | 819 | HTML_FOOTER = doc/footer.html 820 | 821 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 822 | # style sheet that is used by each HTML page. It can be used to 823 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 824 | # will generate a default style sheet. Note that doxygen will try to copy 825 | # the style sheet file to the HTML output directory, so don't put your own 826 | # stylesheet in the HTML output directory as well, or it will be erased! 827 | 828 | HTML_STYLESHEET = 829 | 830 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 831 | # files or namespaces will be aligned in HTML using tables. If set to 832 | # NO a bullet list will be used. 833 | 834 | HTML_ALIGN_MEMBERS = YES 835 | 836 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 837 | # documentation will contain sections that can be hidden and shown after the 838 | # page has loaded. For this to work a browser that supports 839 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 840 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 841 | 842 | HTML_DYNAMIC_SECTIONS = NO 843 | 844 | # If the GENERATE_DOCSET tag is set to YES, additional index files 845 | # will be generated that can be used as input for Apple's Xcode 3 846 | # integrated development environment, introduced with OSX 10.5 (Leopard). 847 | # To create a documentation set, doxygen will generate a Makefile in the 848 | # HTML output directory. Running make will produce the docset in that 849 | # directory and running "make install" will install the docset in 850 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 851 | # it at startup. 852 | # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. 853 | 854 | GENERATE_DOCSET = NO 855 | 856 | # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 857 | # feed. A documentation feed provides an umbrella under which multiple 858 | # documentation sets from a single provider (such as a company or product suite) 859 | # can be grouped. 860 | 861 | DOCSET_FEEDNAME = "Doxygen generated docs" 862 | 863 | # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 864 | # should uniquely identify the documentation set bundle. This should be a 865 | # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 866 | # will append .docset to the name. 867 | 868 | DOCSET_BUNDLE_ID = org.doxygen.Project 869 | 870 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 871 | # will be generated that can be used as input for tools like the 872 | # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 873 | # of the generated HTML documentation. 874 | 875 | GENERATE_HTMLHELP = NO 876 | 877 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 878 | # be used to specify the file name of the resulting .chm file. You 879 | # can add a path in front of the file if the result should not be 880 | # written to the html output directory. 881 | 882 | CHM_FILE = 883 | 884 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 885 | # be used to specify the location (absolute path including file name) of 886 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 887 | # the HTML help compiler on the generated index.hhp. 888 | 889 | HHC_LOCATION = 890 | 891 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 892 | # controls if a separate .chi index file is generated (YES) or that 893 | # it should be included in the master .chm file (NO). 894 | 895 | GENERATE_CHI = NO 896 | 897 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 898 | # is used to encode HtmlHelp index (hhk), content (hhc) and project file 899 | # content. 900 | 901 | CHM_INDEX_ENCODING = 902 | 903 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 904 | # controls whether a binary table of contents is generated (YES) or a 905 | # normal table of contents (NO) in the .chm file. 906 | 907 | BINARY_TOC = NO 908 | 909 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 910 | # to the contents of the HTML help documentation and to the tree view. 911 | 912 | TOC_EXPAND = NO 913 | 914 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 915 | # are set, an additional index file will be generated that can be used as input for 916 | # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 917 | # HTML documentation. 918 | 919 | GENERATE_QHP = NO 920 | 921 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 922 | # be used to specify the file name of the resulting .qch file. 923 | # The path specified is relative to the HTML output folder. 924 | 925 | QCH_FILE = 926 | 927 | # The QHP_NAMESPACE tag specifies the namespace to use when generating 928 | # Qt Help Project output. For more information please see 929 | # http://doc.trolltech.com/qthelpproject.html#namespace 930 | 931 | QHP_NAMESPACE = 932 | 933 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 934 | # Qt Help Project output. For more information please see 935 | # http://doc.trolltech.com/qthelpproject.html#virtual-folders 936 | 937 | QHP_VIRTUAL_FOLDER = doc 938 | 939 | # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 940 | # For more information please see 941 | # http://doc.trolltech.com/qthelpproject.html#custom-filters 942 | 943 | QHP_CUST_FILTER_NAME = 944 | 945 | # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 946 | # Qt Help Project / Custom Filters. 947 | 948 | QHP_CUST_FILTER_ATTRS = 949 | 950 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 951 | # filter section matches. 952 | # Qt Help Project / Filter Attributes. 953 | 954 | QHP_SECT_FILTER_ATTRS = 955 | 956 | # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 957 | # be used to specify the location of Qt's qhelpgenerator. 958 | # If non-empty doxygen will try to run qhelpgenerator on the generated 959 | # .qhp file. 960 | 961 | QHG_LOCATION = 962 | 963 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 964 | # top of each HTML page. The value NO (the default) enables the index and 965 | # the value YES disables it. 966 | 967 | DISABLE_INDEX = NO 968 | 969 | # This tag can be used to set the number of enum values (range [1..20]) 970 | # that doxygen will group on one line in the generated HTML documentation. 971 | 972 | ENUM_VALUES_PER_LINE = 4 973 | 974 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 975 | # structure should be generated to display hierarchical information. 976 | # If the tag value is set to FRAME, a side panel will be generated 977 | # containing a tree-like index structure (just like the one that 978 | # is generated for HTML Help). For this to work a browser that supports 979 | # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 980 | # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 981 | # probably better off using the HTML help feature. Other possible values 982 | # for this tag are: HIERARCHIES, which will generate the Groups, Directories, 983 | # and Class Hierarchy pages using a tree view instead of an ordered list; 984 | # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which 985 | # disables this behavior completely. For backwards compatibility with previous 986 | # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE 987 | # respectively. 988 | 989 | GENERATE_TREEVIEW = NONE 990 | 991 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 992 | # used to set the initial width (in pixels) of the frame in which the tree 993 | # is shown. 994 | 995 | TREEVIEW_WIDTH = 250 996 | 997 | # Use this tag to change the font size of Latex formulas included 998 | # as images in the HTML documentation. The default is 10. Note that 999 | # when you change the font size after a successful doxygen run you need 1000 | # to manually remove any form_*.png images from the HTML output directory 1001 | # to force them to be regenerated. 1002 | 1003 | FORMULA_FONTSIZE = 10 1004 | 1005 | #--------------------------------------------------------------------------- 1006 | # configuration options related to the LaTeX output 1007 | #--------------------------------------------------------------------------- 1008 | 1009 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 1010 | # generate Latex output. 1011 | 1012 | GENERATE_LATEX = NO 1013 | 1014 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 1015 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1016 | # put in front of it. If left blank `latex' will be used as the default path. 1017 | 1018 | LATEX_OUTPUT = latex 1019 | 1020 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1021 | # invoked. If left blank `latex' will be used as the default command name. 1022 | 1023 | LATEX_CMD_NAME = latex 1024 | 1025 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 1026 | # generate index for LaTeX. If left blank `makeindex' will be used as the 1027 | # default command name. 1028 | 1029 | MAKEINDEX_CMD_NAME = makeindex 1030 | 1031 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 1032 | # LaTeX documents. This may be useful for small projects and may help to 1033 | # save some trees in general. 1034 | 1035 | COMPACT_LATEX = NO 1036 | 1037 | # The PAPER_TYPE tag can be used to set the paper type that is used 1038 | # by the printer. Possible values are: a4, a4wide, letter, legal and 1039 | # executive. If left blank a4wide will be used. 1040 | 1041 | PAPER_TYPE = a4wide 1042 | 1043 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 1044 | # packages that should be included in the LaTeX output. 1045 | 1046 | EXTRA_PACKAGES = 1047 | 1048 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 1049 | # the generated latex document. The header should contain everything until 1050 | # the first chapter. If it is left blank doxygen will generate a 1051 | # standard header. Notice: only use this tag if you know what you are doing! 1052 | 1053 | LATEX_HEADER = 1054 | 1055 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 1056 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 1057 | # contain links (just like the HTML output) instead of page references 1058 | # This makes the output suitable for online browsing using a pdf viewer. 1059 | 1060 | PDF_HYPERLINKS = YES 1061 | 1062 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 1063 | # plain latex in the generated Makefile. Set this option to YES to get a 1064 | # higher quality PDF documentation. 1065 | 1066 | USE_PDFLATEX = YES 1067 | 1068 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 1069 | # command to the generated LaTeX files. This will instruct LaTeX to keep 1070 | # running if errors occur, instead of asking the user for help. 1071 | # This option is also used when generating formulas in HTML. 1072 | 1073 | LATEX_BATCHMODE = NO 1074 | 1075 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 1076 | # include the index chapters (such as File Index, Compound Index, etc.) 1077 | # in the output. 1078 | 1079 | LATEX_HIDE_INDICES = NO 1080 | 1081 | #--------------------------------------------------------------------------- 1082 | # configuration options related to the RTF output 1083 | #--------------------------------------------------------------------------- 1084 | 1085 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 1086 | # The RTF output is optimized for Word 97 and may not look very pretty with 1087 | # other RTF readers or editors. 1088 | 1089 | GENERATE_RTF = NO 1090 | 1091 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 1092 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1093 | # put in front of it. If left blank `rtf' will be used as the default path. 1094 | 1095 | RTF_OUTPUT = rtf 1096 | 1097 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 1098 | # RTF documents. This may be useful for small projects and may help to 1099 | # save some trees in general. 1100 | 1101 | COMPACT_RTF = NO 1102 | 1103 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 1104 | # will contain hyperlink fields. The RTF file will 1105 | # contain links (just like the HTML output) instead of page references. 1106 | # This makes the output suitable for online browsing using WORD or other 1107 | # programs which support those fields. 1108 | # Note: wordpad (write) and others do not support links. 1109 | 1110 | RTF_HYPERLINKS = NO 1111 | 1112 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 1113 | # config file, i.e. a series of assignments. You only have to provide 1114 | # replacements, missing definitions are set to their default value. 1115 | 1116 | RTF_STYLESHEET_FILE = 1117 | 1118 | # Set optional variables used in the generation of an rtf document. 1119 | # Syntax is similar to doxygen's config file. 1120 | 1121 | RTF_EXTENSIONS_FILE = 1122 | 1123 | #--------------------------------------------------------------------------- 1124 | # configuration options related to the man page output 1125 | #--------------------------------------------------------------------------- 1126 | 1127 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 1128 | # generate man pages 1129 | 1130 | GENERATE_MAN = NO 1131 | 1132 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 1133 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1134 | # put in front of it. If left blank `man' will be used as the default path. 1135 | 1136 | MAN_OUTPUT = man 1137 | 1138 | # The MAN_EXTENSION tag determines the extension that is added to 1139 | # the generated man pages (default is the subroutine's section .3) 1140 | 1141 | MAN_EXTENSION = .3 1142 | 1143 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 1144 | # then it will generate one additional man file for each entity 1145 | # documented in the real man page(s). These additional files 1146 | # only source the real man page, but without them the man command 1147 | # would be unable to find the correct page. The default is NO. 1148 | 1149 | MAN_LINKS = NO 1150 | 1151 | #--------------------------------------------------------------------------- 1152 | # configuration options related to the XML output 1153 | #--------------------------------------------------------------------------- 1154 | 1155 | # If the GENERATE_XML tag is set to YES Doxygen will 1156 | # generate an XML file that captures the structure of 1157 | # the code including all documentation. 1158 | 1159 | GENERATE_XML = NO 1160 | 1161 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 1162 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1163 | # put in front of it. If left blank `xml' will be used as the default path. 1164 | 1165 | XML_OUTPUT = xml 1166 | 1167 | # The XML_SCHEMA tag can be used to specify an XML schema, 1168 | # which can be used by a validating XML parser to check the 1169 | # syntax of the XML files. 1170 | 1171 | XML_SCHEMA = 1172 | 1173 | # The XML_DTD tag can be used to specify an XML DTD, 1174 | # which can be used by a validating XML parser to check the 1175 | # syntax of the XML files. 1176 | 1177 | XML_DTD = 1178 | 1179 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 1180 | # dump the program listings (including syntax highlighting 1181 | # and cross-referencing information) to the XML output. Note that 1182 | # enabling this will significantly increase the size of the XML output. 1183 | 1184 | XML_PROGRAMLISTING = YES 1185 | 1186 | #--------------------------------------------------------------------------- 1187 | # configuration options for the AutoGen Definitions output 1188 | #--------------------------------------------------------------------------- 1189 | 1190 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 1191 | # generate an AutoGen Definitions (see autogen.sf.net) file 1192 | # that captures the structure of the code including all 1193 | # documentation. Note that this feature is still experimental 1194 | # and incomplete at the moment. 1195 | 1196 | GENERATE_AUTOGEN_DEF = NO 1197 | 1198 | #--------------------------------------------------------------------------- 1199 | # configuration options related to the Perl module output 1200 | #--------------------------------------------------------------------------- 1201 | 1202 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 1203 | # generate a Perl module file that captures the structure of 1204 | # the code including all documentation. Note that this 1205 | # feature is still experimental and incomplete at the 1206 | # moment. 1207 | 1208 | GENERATE_PERLMOD = NO 1209 | 1210 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 1211 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 1212 | # to generate PDF and DVI output from the Perl module output. 1213 | 1214 | PERLMOD_LATEX = NO 1215 | 1216 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 1217 | # nicely formatted so it can be parsed by a human reader. This is useful 1218 | # if you want to understand what is going on. On the other hand, if this 1219 | # tag is set to NO the size of the Perl module output will be much smaller 1220 | # and Perl will parse it just the same. 1221 | 1222 | PERLMOD_PRETTY = YES 1223 | 1224 | # The names of the make variables in the generated doxyrules.make file 1225 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1226 | # This is useful so different doxyrules.make files included by the same 1227 | # Makefile don't overwrite each other's variables. 1228 | 1229 | PERLMOD_MAKEVAR_PREFIX = 1230 | 1231 | #--------------------------------------------------------------------------- 1232 | # Configuration options related to the preprocessor 1233 | #--------------------------------------------------------------------------- 1234 | 1235 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1236 | # evaluate all C-preprocessor directives found in the sources and include 1237 | # files. 1238 | 1239 | ENABLE_PREPROCESSING = YES 1240 | 1241 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1242 | # names in the source code. If set to NO (the default) only conditional 1243 | # compilation will be performed. Macro expansion can be done in a controlled 1244 | # way by setting EXPAND_ONLY_PREDEF to YES. 1245 | 1246 | MACRO_EXPANSION = NO 1247 | 1248 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1249 | # then the macro expansion is limited to the macros specified with the 1250 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1251 | 1252 | EXPAND_ONLY_PREDEF = NO 1253 | 1254 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1255 | # in the INCLUDE_PATH (see below) will be search if a #include is found. 1256 | 1257 | SEARCH_INCLUDES = YES 1258 | 1259 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1260 | # contain include files that are not input files but should be processed by 1261 | # the preprocessor. 1262 | 1263 | INCLUDE_PATH = 1264 | 1265 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1266 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1267 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1268 | # be used. 1269 | 1270 | INCLUDE_FILE_PATTERNS = 1271 | 1272 | # The PREDEFINED tag can be used to specify one or more macro names that 1273 | # are defined before the preprocessor is started (similar to the -D option of 1274 | # gcc). The argument of the tag is a list of macros of the form: name 1275 | # or name=definition (no spaces). If the definition and the = are 1276 | # omitted =1 is assumed. To prevent a macro definition from being 1277 | # undefined via #undef or recursively expanded use the := operator 1278 | # instead of the = operator. 1279 | 1280 | PREDEFINED = 1281 | 1282 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1283 | # this tag can be used to specify a list of macro names that should be expanded. 1284 | # The macro definition that is found in the sources will be used. 1285 | # Use the PREDEFINED tag if you want to use a different macro definition. 1286 | 1287 | EXPAND_AS_DEFINED = 1288 | 1289 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1290 | # doxygen's preprocessor will remove all function-like macros that are alone 1291 | # on a line, have an all uppercase name, and do not end with a semicolon. Such 1292 | # function macros are typically used for boiler-plate code, and will confuse 1293 | # the parser if not removed. 1294 | 1295 | SKIP_FUNCTION_MACROS = YES 1296 | 1297 | #--------------------------------------------------------------------------- 1298 | # Configuration::additions related to external references 1299 | #--------------------------------------------------------------------------- 1300 | 1301 | # The TAGFILES option can be used to specify one or more tagfiles. 1302 | # Optionally an initial location of the external documentation 1303 | # can be added for each tagfile. The format of a tag file without 1304 | # this location is as follows: 1305 | # TAGFILES = file1 file2 ... 1306 | # Adding location for the tag files is done as follows: 1307 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1308 | # where "loc1" and "loc2" can be relative or absolute paths or 1309 | # URLs. If a location is present for each tag, the installdox tool 1310 | # does not have to be run to correct the links. 1311 | # Note that each tag file must have a unique name 1312 | # (where the name does NOT include the path) 1313 | # If a tag file is not located in the directory in which doxygen 1314 | # is run, you must also specify the path to the tagfile here. 1315 | 1316 | TAGFILES = 1317 | 1318 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1319 | # a tag file that is based on the input files it reads. 1320 | 1321 | GENERATE_TAGFILE = 1322 | 1323 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1324 | # in the class index. If set to NO only the inherited external classes 1325 | # will be listed. 1326 | 1327 | ALLEXTERNALS = NO 1328 | 1329 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1330 | # in the modules index. If set to NO, only the current project's groups will 1331 | # be listed. 1332 | 1333 | EXTERNAL_GROUPS = YES 1334 | 1335 | # The PERL_PATH should be the absolute path and name of the perl script 1336 | # interpreter (i.e. the result of `which perl'). 1337 | 1338 | PERL_PATH = /usr/bin/perl 1339 | 1340 | #--------------------------------------------------------------------------- 1341 | # Configuration options related to the dot tool 1342 | #--------------------------------------------------------------------------- 1343 | 1344 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1345 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1346 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1347 | # this option is superseded by the HAVE_DOT option below. This is only a 1348 | # fallback. It is recommended to install and use dot, since it yields more 1349 | # powerful graphs. 1350 | 1351 | CLASS_DIAGRAMS = NO 1352 | 1353 | # You can define message sequence charts within doxygen comments using the \msc 1354 | # command. Doxygen will then run the mscgen tool (see 1355 | # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 1356 | # documentation. The MSCGEN_PATH tag allows you to specify the directory where 1357 | # the mscgen tool resides. If left empty the tool is assumed to be found in the 1358 | # default search path. 1359 | 1360 | MSCGEN_PATH = 1361 | 1362 | # If set to YES, the inheritance and collaboration graphs will hide 1363 | # inheritance and usage relations if the target is undocumented 1364 | # or is not a class. 1365 | 1366 | HIDE_UNDOC_RELATIONS = YES 1367 | 1368 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1369 | # available from the path. This tool is part of Graphviz, a graph visualization 1370 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1371 | # have no effect if this option is set to NO (the default) 1372 | 1373 | HAVE_DOT = NO 1374 | 1375 | # By default doxygen will write a font called FreeSans.ttf to the output 1376 | # directory and reference it in all dot files that doxygen generates. This 1377 | # font does not include all possible unicode characters however, so when you need 1378 | # these (or just want a differently looking font) you can specify the font name 1379 | # using DOT_FONTNAME. You need need to make sure dot is able to find the font, 1380 | # which can be done by putting it in a standard location or by setting the 1381 | # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 1382 | # containing the font. 1383 | 1384 | DOT_FONTNAME = FreeSans 1385 | 1386 | # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 1387 | # The default size is 10pt. 1388 | 1389 | DOT_FONTSIZE = 10 1390 | 1391 | # By default doxygen will tell dot to use the output directory to look for the 1392 | # FreeSans.ttf font (which doxygen will put there itself). If you specify a 1393 | # different font using DOT_FONTNAME you can set the path where dot 1394 | # can find it using this tag. 1395 | 1396 | DOT_FONTPATH = 1397 | 1398 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1399 | # will generate a graph for each documented class showing the direct and 1400 | # indirect inheritance relations. Setting this tag to YES will force the 1401 | # the CLASS_DIAGRAMS tag to NO. 1402 | 1403 | CLASS_GRAPH = YES 1404 | 1405 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1406 | # will generate a graph for each documented class showing the direct and 1407 | # indirect implementation dependencies (inheritance, containment, and 1408 | # class references variables) of the class with other documented classes. 1409 | 1410 | COLLABORATION_GRAPH = YES 1411 | 1412 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1413 | # will generate a graph for groups, showing the direct groups dependencies 1414 | 1415 | GROUP_GRAPHS = YES 1416 | 1417 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1418 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1419 | # Language. 1420 | 1421 | UML_LOOK = NO 1422 | 1423 | # If set to YES, the inheritance and collaboration graphs will show the 1424 | # relations between templates and their instances. 1425 | 1426 | TEMPLATE_RELATIONS = NO 1427 | 1428 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1429 | # tags are set to YES then doxygen will generate a graph for each documented 1430 | # file showing the direct and indirect include dependencies of the file with 1431 | # other documented files. 1432 | 1433 | INCLUDE_GRAPH = YES 1434 | 1435 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1436 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1437 | # documented header file showing the documented files that directly or 1438 | # indirectly include this file. 1439 | 1440 | INCLUDED_BY_GRAPH = YES 1441 | 1442 | # If the CALL_GRAPH and HAVE_DOT options are set to YES then 1443 | # doxygen will generate a call dependency graph for every global function 1444 | # or class method. Note that enabling this option will significantly increase 1445 | # the time of a run. So in most cases it will be better to enable call graphs 1446 | # for selected functions only using the \callgraph command. 1447 | 1448 | CALL_GRAPH = NO 1449 | 1450 | # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 1451 | # doxygen will generate a caller dependency graph for every global function 1452 | # or class method. Note that enabling this option will significantly increase 1453 | # the time of a run. So in most cases it will be better to enable caller 1454 | # graphs for selected functions only using the \callergraph command. 1455 | 1456 | CALLER_GRAPH = NO 1457 | 1458 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1459 | # will graphical hierarchy of all classes instead of a textual one. 1460 | 1461 | GRAPHICAL_HIERARCHY = YES 1462 | 1463 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1464 | # then doxygen will show the dependencies a directory has on other directories 1465 | # in a graphical way. The dependency relations are determined by the #include 1466 | # relations between the files in the directories. 1467 | 1468 | DIRECTORY_GRAPH = YES 1469 | 1470 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1471 | # generated by dot. Possible values are png, jpg, or gif 1472 | # If left blank png will be used. 1473 | 1474 | DOT_IMAGE_FORMAT = png 1475 | 1476 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1477 | # found. If left blank, it is assumed the dot tool can be found in the path. 1478 | 1479 | DOT_PATH = 1480 | 1481 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1482 | # contain dot files that are included in the documentation (see the 1483 | # \dotfile command). 1484 | 1485 | DOTFILE_DIRS = 1486 | 1487 | # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1488 | # nodes that will be shown in the graph. If the number of nodes in a graph 1489 | # becomes larger than this value, doxygen will truncate the graph, which is 1490 | # visualized by representing a node as a red box. Note that doxygen if the 1491 | # number of direct children of the root node in a graph is already larger than 1492 | # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 1493 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1494 | 1495 | DOT_GRAPH_MAX_NODES = 50 1496 | 1497 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1498 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1499 | # from the root by following a path via at most 3 edges will be shown. Nodes 1500 | # that lay further from the root node will be omitted. Note that setting this 1501 | # option to 1 or 2 may greatly reduce the computation time needed for large 1502 | # code bases. Also note that the size of a graph can be further restricted by 1503 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1504 | 1505 | MAX_DOT_GRAPH_DEPTH = 0 1506 | 1507 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1508 | # background. This is disabled by default, because dot on Windows does not 1509 | # seem to support this out of the box. Warning: Depending on the platform used, 1510 | # enabling this option may lead to badly anti-aliased labels on the edges of 1511 | # a graph (i.e. they become hard to read). 1512 | 1513 | DOT_TRANSPARENT = NO 1514 | 1515 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1516 | # files in one run (i.e. multiple -o and -T options on the command line). This 1517 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1518 | # support this, this feature is disabled by default. 1519 | 1520 | DOT_MULTI_TARGETS = NO 1521 | 1522 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1523 | # generate a legend page explaining the meaning of the various boxes and 1524 | # arrows in the dot generated graphs. 1525 | 1526 | GENERATE_LEGEND = YES 1527 | 1528 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1529 | # remove the intermediate dot files that are used to generate 1530 | # the various graphs. 1531 | 1532 | DOT_CLEANUP = YES 1533 | 1534 | #--------------------------------------------------------------------------- 1535 | # Options related to the search engine 1536 | #--------------------------------------------------------------------------- 1537 | 1538 | # The SEARCHENGINE tag specifies whether or not a search engine should be 1539 | # used. If set to NO the values of all tags below this one will be ignored. 1540 | 1541 | SEARCHENGINE = NO 1542 | -------------------------------------------------------------------------------- /doc/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/intro.dox: -------------------------------------------------------------------------------- 1 | /** @mainpage Mustache-c 2 | * 3 | * @section intro Introduction 4 | * 5 | * This project implement mustache templates in pure C. It not tend to implement all features, but stick to best ones and take maximum of them. 6 | * There is no partials, no html escaping, no set delimiters. However it have very flexible api and could be used in any environment. It pre-compiles 7 | * input template, so render would be very fast. 8 | * 9 | * User must supply some callbacks for api to query variable and section values, so you can use, sort of, lambda functions even in simple variable get. 10 | * Also it expect from user read and write callbacks - to read template and write to destination, whatever it would be. 11 | * 12 | * @section read_next Api 13 | * 14 | * Look at @ref mustache.h for full api description. 15 | * 16 | * @section license License 17 | * 18 | * License is LGPL v3.0. 19 | * 20 | */ 21 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS = simple array 2 | 3 | simple_CFLAGS = -I$(top_srcdir)/src/ 4 | simple_SOURCES = simple.c 5 | simple_LDADD = $(top_srcdir)/src/libmustache_c.la 6 | 7 | array_CFLAGS = -I$(top_srcdir)/src/ 8 | array_SOURCES = array.c 9 | array_LDADD = $(top_srcdir)/src/libmustache_c.la 10 | -------------------------------------------------------------------------------- /examples/array.c: -------------------------------------------------------------------------------- 1 | /* This simple example reads the file "array.template" from the current 2 | * directory and replaces the section with an array of names. It shows on 3 | * how to deal with sections that are actually arrays. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | static FILE *template = NULL; 16 | 17 | static char *names[] = 18 | { 19 | "Angus McFife", 20 | "Hootsman", 21 | "Ser Proletius", 22 | "Zargothrax", 23 | "Ralathor", 24 | NULL, 25 | }; 26 | 27 | static uintmax_t 28 | mustache_read_file(mustache_api_t *api, void *data, char *buf, uintmax_t sz) 29 | { 30 | /* Do whatever needs to be done to get sz number of bytes into buf. 31 | */ 32 | return fread(buf, sizeof(char), sz, template); 33 | } 34 | 35 | static uintmax_t 36 | mustache_write_stdout(mustache_api_t *api, void *data, 37 | char const *buf, uintmax_t sz) 38 | { 39 | /* Do whatever it takes to write sz number of bytes from buf to somewhere. 40 | */ 41 | return fwrite(buf, sizeof(char), sz, stdout); 42 | } 43 | 44 | static uintmax_t 45 | mustache_write_null(mustache_api_t *api, void *data, 46 | char const *buf, uintmax_t sz) 47 | { 48 | /* Fake success 49 | */ 50 | return sz; 51 | } 52 | 53 | static void 54 | mustache_error(mustache_api_t *api, void *data, 55 | uintmax_t line, char const *error) 56 | { 57 | fprintf(stderr, "error in template: %" PRIu64 ": %s\n", line, error); 58 | } 59 | 60 | static uintmax_t 61 | mustache_sectget(mustache_api_t *api, void *data, mustache_token_section_t *s) 62 | { 63 | if (strcmp(s->name, "members") == 0) { 64 | /* To resolve an array, repeatedly call mustache_render() on the 65 | * section but pass different user defined data. The user defined 66 | * data should point to one item of the array. 67 | */ 68 | char **name = names; 69 | 70 | for (; *name; name++) { 71 | if (!mustache_render(api, *name, s->section)) { 72 | return false; 73 | } 74 | } 75 | 76 | return true; 77 | } 78 | 79 | return false; 80 | } 81 | 82 | static uintmax_t 83 | mustache_varget(mustache_api_t *api, void *data, mustache_token_variable_t *t) 84 | { 85 | if (strcmp(t->text, "name") == 0) { 86 | char *name = (char*)data; 87 | 88 | if (name == NULL) { 89 | fprintf(stderr, "error: name requested but not passed\n"); 90 | return false; 91 | } 92 | 93 | api->write(api, data, (char*)name, strlen(name)); 94 | return true; 95 | } 96 | 97 | fprintf(stderr, "error: unknown variable: %s\n", t->text); 98 | /* If you return false, parsing will stop. To ignore unknown variables 99 | * you should always return true. 100 | */ 101 | 102 | return false; 103 | } 104 | 105 | int main(int ac, char **av) 106 | { 107 | mustache_api_t api; 108 | mustache_template_t *t = NULL; 109 | 110 | template = fopen("array.template", "r"); 111 | if (template == NULL) { 112 | fprintf(stderr, "error: failed to open file array.template: %s\n", 113 | strerror(errno) 114 | ); 115 | return 2; 116 | } 117 | 118 | api.read = mustache_read_file; 119 | api.write = NULL; 120 | api.error = mustache_error; 121 | api.sectget = mustache_sectget; 122 | api.varget = mustache_varget; 123 | 124 | t = mustache_compile(&api, NULL); 125 | if (t == NULL) { 126 | fclose(template); 127 | return 3; 128 | } 129 | 130 | /* Prerender also calls sectget() and varget() handlers. If you 131 | * call api->write() in those handlers then stuff is written which 132 | * you might not want. One way to circumvent that is to have a null 133 | * writer. 134 | */ 135 | api.write = mustache_write_null; 136 | if (!mustache_prerender(&api, NULL, t)) { 137 | fclose(template); 138 | return 3; 139 | } 140 | 141 | /* And then set the proper writer on the actual render call. 142 | */ 143 | api.write = mustache_write_stdout; 144 | if (!mustache_render(&api, NULL, t)) { 145 | fclose(template); 146 | return 3; 147 | } 148 | 149 | fclose(template); 150 | 151 | return 0; 152 | } 153 | -------------------------------------------------------------------------------- /examples/array.template: -------------------------------------------------------------------------------- 1 | Members: 2 | {{#members}} - {{name}} 3 | {{/members}} 4 | -------------------------------------------------------------------------------- /examples/simple.c: -------------------------------------------------------------------------------- 1 | /* This simple example reads the file "simple.template" from the current 2 | * directory and replaces the variable "name" with a self defined string. 3 | * It shows basic usage of the mustache-c API. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | static FILE *template = NULL; 16 | 17 | static uintmax_t 18 | mustache_read_file(mustache_api_t *api, void *data, char *buf, uintmax_t sz) 19 | { 20 | /* Do whatever needs to be done to get sz number of bytes into buf. 21 | */ 22 | return fread(buf, sizeof(char), sz, template); 23 | } 24 | 25 | static uintmax_t 26 | mustache_write_stdout(mustache_api_t *api, void *data, 27 | char const *buf, uintmax_t sz) 28 | { 29 | /* Do whatever it takes to write sz number of bytes from buf to somewhere. 30 | */ 31 | return fwrite(buf, sizeof(char), sz, stdout); 32 | } 33 | 34 | static void 35 | mustache_error(mustache_api_t *api, void *data, 36 | uintmax_t line, char const *error) 37 | { 38 | fprintf(stderr, "error in template: %" PRIu64 ": %s\n", line, error); 39 | } 40 | 41 | static uintmax_t 42 | mustache_sectget(mustache_api_t *api, void *data, mustache_token_section_t *s) 43 | { 44 | /* Compare to s->name and do section related stuff. This usually revolves 45 | * around calling mustache_render() again on the section itself. 46 | * 47 | * See array.c for an example on how to handle arrays. 48 | */ 49 | return mustache_render(api, data, s->section); 50 | } 51 | 52 | static uintmax_t 53 | mustache_varget(mustache_api_t *api, void *data, mustache_token_variable_t *t) 54 | { 55 | static const char *name = "Angus McFife"; 56 | 57 | if (strcmp(t->text, "name") == 0) { 58 | api->write(api, data, name, strlen(name)); 59 | return true; 60 | } 61 | 62 | fprintf(stderr, "error: unknown variable: %s\n", t->text); 63 | /* If you return false, parsing will stop. To ignore unknown variables 64 | * you should always return true. 65 | */ 66 | 67 | return false; 68 | } 69 | 70 | int main(int ac, char **av) 71 | { 72 | mustache_api_t api; 73 | mustache_template_t *t = NULL; 74 | 75 | template = fopen("simple.template", "r"); 76 | if (template == NULL) { 77 | fprintf(stderr, "error: failed to open file simple.template: %s\n", 78 | strerror(errno) 79 | ); 80 | return 2; 81 | } 82 | 83 | api.read = mustache_read_file; 84 | api.write = mustache_write_stdout; 85 | api.error = mustache_error; 86 | api.sectget = mustache_sectget; 87 | api.varget = mustache_varget; 88 | 89 | t = mustache_compile(&api, NULL); 90 | if (t == NULL) { 91 | fclose(template); 92 | return 3; 93 | } 94 | 95 | if (!mustache_render(&api, NULL, t)) { 96 | fclose(template); 97 | return 3; 98 | } 99 | 100 | fclose(template); 101 | 102 | return 0; 103 | } 104 | -------------------------------------------------------------------------------- /examples/simple.template: -------------------------------------------------------------------------------- 1 | Hello World to {{name}}! 2 | -------------------------------------------------------------------------------- /mustache_c-1.0.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_NAME@ 7 | Description: Mustache implementation in pure C 8 | URL: https://github.com/x86-64/mustache-c 9 | Version: @VERSION@ 10 | Libs: -lmustache_c -L${libdir} 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | GENSOURCE = parser.tab.h parser.tab.c parser.lex.c 2 | 3 | lib_LTLIBRARIES=libmustache_c.la 4 | libmustache_c_la_SOURCES= $(GENSOURCE) mustache-internal.h mustache.c 5 | libmustache_c_la_LDFLAGS= -module -avoid-version -shared 6 | EXTRA_DIST = parser.l parser.y 7 | CLEANFILES = $(GENSOURCE) 8 | 9 | include_HEADERS=mustache.h 10 | 11 | parser.tab.c: parser.lex.c parser.y 12 | ${BISON} -p mustache_p_ -d -b parser parser.y 13 | parser.lex.c: parser.l 14 | ${FLEX} -Pmustache_p_ --bison-bridge -o parser.lex.c parser.l 15 | 16 | -------------------------------------------------------------------------------- /src/mustache-internal.h: -------------------------------------------------------------------------------- 1 | #ifndef MUSTACHEC_INTERNAL_H 2 | #define MUSTACHEC_INTERNAL_H 3 | 4 | typedef struct mustache_ctx { 5 | mustache_api_t *api; 6 | mustache_template_t *template; 7 | void *userdata; 8 | } mustache_ctx; 9 | 10 | void *internal_mustache_malloc(size_t size); 11 | 12 | void *internal_mustache_realloc(void *dst, size_t size); 13 | 14 | void *internal_mustache_calloc(size_t num, size_t size); 15 | 16 | void *internal_mustache_free(void *dst); 17 | 18 | char *mustache_strdup(const char *src); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/mustache.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "mustache.h" 4 | #include "mustache-internal.h" 5 | 6 | static mustache_memory_malloc_f mustache_memory_malloc = malloc; 7 | static mustache_memory_realloc_f mustache_memory_realloc = realloc; 8 | static mustache_memory_calloc_f mustache_memory_calloc = calloc; 9 | static mustache_memory_free_f mustache_memory_free = free; 10 | 11 | // explicit strdup that doesn't hide malloc 12 | char *mustache_strdup(const char *src) { 13 | size_t len = strlen(src) + 1; 14 | char *s = internal_mustache_malloc(len); 15 | if (s == NULL) 16 | return NULL; 17 | return (char *)memcpy(s, src, len); 18 | } 19 | 20 | void * 21 | internal_mustache_malloc(size_t size) 22 | { 23 | return mustache_memory_malloc(size); 24 | } 25 | 26 | void * 27 | internal_mustache_realloc(void *dst, size_t size) 28 | { 29 | return mustache_memory_realloc(dst, size); 30 | } 31 | 32 | void * 33 | internal_mustache_calloc(size_t num, size_t size) 34 | { 35 | return mustache_memory_calloc(num, size); 36 | } 37 | 38 | void * 39 | internal_mustache_free(void *dst) 40 | { 41 | mustache_memory_free(dst); 42 | return NULL; 43 | } 44 | 45 | void 46 | mustache_memory_setup(mustache_memory_malloc_f new_malloc, mustache_memory_realloc_f new_realloc, 47 | mustache_memory_calloc_f new_calloc, mustache_memory_free_f new_free) 48 | { 49 | mustache_memory_malloc = new_malloc; 50 | mustache_memory_realloc = new_realloc; 51 | mustache_memory_calloc = new_calloc; 52 | mustache_memory_free = new_free; 53 | } 54 | -------------------------------------------------------------------------------- /src/mustache.h: -------------------------------------------------------------------------------- 1 | #ifndef MUSTACHE_H 2 | #define MUSTACHE_H 3 | 4 | #include 5 | 6 | /** @file mustache.h */ 7 | 8 | typedef struct mustache_api_t mustache_api_t; ///< Api typedef 9 | typedef struct mustache_token_t mustache_token_t; ///< Token typedef 10 | typedef struct mustache_token_t mustache_template_t; ///< Template typedef 11 | typedef struct mustache_token_variable_t mustache_token_variable_t; ///< Token variable typedef 12 | typedef struct mustache_token_section_t mustache_token_section_t; ///< Token section typedef 13 | 14 | /** Read callback, used only on compilation stage. Write your data in buffer and return number of bytes read. 15 | * @param api Current api set, probably not used in this callback 16 | * @param userdata Userdata passed to mustache_compile function 17 | * @param buffer Output buffer 18 | * @param buffer_size Output buffer size 19 | * @retval 0 No more data (EOF) 20 | * @retval >0 Successful call, number indicate number of bytes read 21 | */ 22 | typedef uintmax_t (*mustache_api_read) (mustache_api_t *api, void *userdata, char *buffer, uintmax_t buffer_size); 23 | 24 | /** Write callback. Save input data in desired place. 25 | * @param api Current api set 26 | * @param userdata Userdata passed to mustache_render function 27 | * @param buffer Input buffer 28 | * @param buffer_size Input buffer size 29 | * @retval 0 Error occured 30 | * @retval >0 Successful call 31 | */ 32 | typedef uintmax_t (*mustache_api_write) (mustache_api_t *api, void *userdata, char const *buffer, uintmax_t buffer_size); 33 | 34 | /** Get variable callback. User call ->write api to dump variable value to output, or do nothing. 35 | * @param api Current api set 36 | * @param userdata Userdata passed to mustache_render function 37 | * @param token Mustache variable token 38 | * @retval 0 Error occured 39 | * @retval >0 Successful call 40 | */ 41 | typedef uintmax_t (*mustache_api_varget) (mustache_api_t *api, void *userdata, mustache_token_variable_t *token); 42 | 43 | /** Get section callback. User call iterativly render routines on section, or do nothing. 44 | * @param api Current api set 45 | * @param userdata Userdata passed to mustache_render function 46 | * @param token Mustache section token 47 | * @retval 0 Error occured 48 | * @retval >0 Successful call 49 | */ 50 | typedef uintmax_t (*mustache_api_sectget)(mustache_api_t *api, void *userdata, mustache_token_section_t *token); 51 | 52 | /** Errors callback. Used only on compilation stage. 53 | * @param api Current api set 54 | * @param userdata Userdata passed to mustache_compile function 55 | * @param lineno Line number on which error occured 56 | * @param error Error description 57 | */ 58 | typedef void (*mustache_api_error) (mustache_api_t *api, void *userdata, uintmax_t lineno, char const *error); 59 | 60 | /** Free userdata callback. 61 | * @param api Current api set 62 | * @param userdata Userdata saved in tokens 63 | */ 64 | typedef void (*mustache_api_freedata)(mustache_api_t *api, void *userdata); 65 | 66 | /** Token type enum */ 67 | typedef enum mustache_token_type_t { 68 | TOKEN_TEXT, ///< Type text 69 | TOKEN_VARIABLE, ///< Type variable 70 | TOKEN_SECTION ///< Type section 71 | } mustache_token_type_t; 72 | 73 | struct mustache_token_variable_t { 74 | char *text; ///< Text or variable name 75 | uintmax_t text_length; ///< Text length or variable name length 76 | int escaped; ///< Whether token should be escaped 77 | void *userdata; ///< Userdata 78 | }; 79 | 80 | struct mustache_token_section_t { 81 | char *name; ///< Section name 82 | mustache_token_t *section; ///< Section template 83 | uintmax_t inverted; ///< Inverted section or not 84 | void *userdata; ///< Userdata 85 | }; 86 | 87 | struct mustache_token_t { 88 | mustache_token_type_t type; ///< Token type 89 | 90 | union { 91 | mustache_token_variable_t token_simple; 92 | mustache_token_section_t token_section; 93 | }; 94 | 95 | mustache_token_t *next; ///< Next token in chain 96 | }; 97 | 98 | struct mustache_api_t { 99 | mustache_api_read read; ///< Read callback 100 | mustache_api_write write; ///< Write callback 101 | mustache_api_varget varget; ///< Get variable callback 102 | mustache_api_sectget sectget; ///< Get section callback 103 | mustache_api_error error; ///< Error callback 104 | mustache_api_freedata freedata; ///< Free userdata callback 105 | }; 106 | 107 | // api 108 | 109 | /** Compile template 110 | * @param api Current api set 111 | * @param userdata Userdata passed to ->read function 112 | * @retval NULL Error occured 113 | * @retval !NULL Successful call 114 | */ 115 | mustache_template_t * mustache_compile(mustache_api_t *api, void *userdata); 116 | 117 | /** Prerender template. You will receive ->varget and ->sectget callbacks only, precompute some info if needed and save to userdata field. 118 | * @param api Current api set 119 | * @param userdata Userdata passed to ->read function 120 | * @param template Template to use for rendering 121 | * @retval 0 Error occured 122 | * @retval >0 Successful call 123 | */ 124 | uintmax_t mustache_prerender(mustache_api_t *api, void *userdata, mustache_template_t *template); 125 | 126 | /** Render template 127 | * @param api Current api set 128 | * @param userdata Userdata passed to ->write and other functions 129 | * @param template Template to use for rendering 130 | * @retval 0 Error occured 131 | * @retval >0 Successful call 132 | */ 133 | uintmax_t mustache_render (mustache_api_t *api, void *userdata, mustache_template_t *template); 134 | 135 | /** Free template 136 | * @param template Template to free 137 | */ 138 | void mustache_free (mustache_api_t *api, mustache_template_t *template); 139 | 140 | // helpers (build with --enable-helpers, default) 141 | 142 | /** Helper context */ 143 | typedef struct mustache_str_ctx { 144 | char *string; ///< String to read or write 145 | 146 | uintmax_t offset; ///< Internal data. Current string offset. 147 | } mustache_str_ctx; 148 | 149 | uintmax_t mustache_std_strread (mustache_api_t *api, void *userdata, char *buffer, uintmax_t buffer_size); ///< Helper api function to read from plain C string 150 | uintmax_t mustache_std_strwrite (mustache_api_t *api, void *userdata, char const *buffer, uintmax_t buffer_size); ///< Helper api function to write to plain C string 151 | 152 | // debug api (build with --enable-debug, not default) 153 | void mustache_dump (mustache_template_t *template); ///< Debug dump template 154 | 155 | typedef void *(*mustache_memory_malloc_f)(size_t size); 156 | typedef void *(*mustache_memory_realloc_f)(void *dst, size_t size); 157 | typedef void *(*mustache_memory_calloc_f)(size_t num, size_t size); 158 | typedef void (*mustache_memory_free_f)(void *dst); 159 | 160 | void 161 | mustache_memory_setup(mustache_memory_malloc_f new_malloc, mustache_memory_realloc_f new_realloc, 162 | mustache_memory_calloc_f new_calloc, mustache_memory_free_f new_free); 163 | 164 | #endif 165 | -------------------------------------------------------------------------------- /src/parser.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include "config.h" 4 | #include "mustache.h" 5 | #include "mustache-internal.h" 6 | #include "parser.tab.h" 7 | %} 8 | 9 | %option noyywrap 10 | %option case-insensitive 11 | %option noinput 12 | %option nounput 13 | %option yylineno 14 | 15 | %x comment 16 | %x mustag 17 | 18 | name [a-z0-9.][a-z0-9_:.-]* 19 | special [#^/] 20 | 21 | %% 22 | 23 | [^*]* 24 | "*"+[^*/]* 25 | "*"+"/" BEGIN(INITIAL); 26 | 27 | {special} { return *yytext; } 28 | {name} { yylval->text = mustache_strdup(yytext); return TEXT; } 29 | "}}" { BEGIN(INITIAL); return MUSTAG_END; } 30 | "}}}" { BEGIN(INITIAL); return MUSTAG_NOESC_END; } 31 | 32 | "//"+[^\n]* { } 33 | "/*" { BEGIN(comment); } 34 | "{{" { BEGIN(mustag); return MUSTAG_START; } 35 | "{{{" { BEGIN(mustag); return MUSTAG_NOESC_START; } 36 | 37 | "{" | 38 | [^{]* { yylval->text = mustache_strdup(yytext); return TEXT; } 39 | 40 | %% 41 | -------------------------------------------------------------------------------- /src/parser.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define YY_END_OF_BUFFER_CHAR 0 12 | typedef struct yy_buffer_state *YY_BUFFER_STATE; 13 | typedef size_t yy_size_t; 14 | extern YY_BUFFER_STATE mustache_p__scan_buffer (char *base,yy_size_t size ); 15 | extern int mustache_p_lex_destroy(void); 16 | extern int mustache_p_get_lineno(void); 17 | 18 | void yyerror (mustache_ctx *, const char *); 19 | 20 | %} 21 | 22 | %start start 23 | 24 | %define api.pure 25 | %parse-param {mustache_ctx *ctx} 26 | 27 | %union { 28 | char *text; 29 | mustache_token_t *template; 30 | } 31 | %token TEXT MUSTAG_START MUSTAG_END 32 | %type TEXT MUSTAG_START MUSTAG_END text 33 | 34 | %token MUSTAG_NOESC_START "{{{" 35 | %token MUSTAG_NOESC_END "}}}" 36 | 37 | %type