apex-ruby 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +119 -0
- data/apex-ruby.gemspec +31 -0
- data/ext/apex_ext/apex_ext.c +215 -0
- data/ext/apex_ext/apex_src/BENCHMARK.md +32 -0
- data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +67 -0
- data/ext/apex_ext/apex_src/CHANGELOG.md +2454 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +454 -0
- data/ext/apex_ext/apex_src/Dockerfile.linux-build +15 -0
- data/ext/apex_ext/apex_src/Formula/apex.rb +38 -0
- data/ext/apex_ext/apex_src/Info.plist.in +27 -0
- data/ext/apex_ext/apex_src/LICENSE +21 -0
- data/ext/apex_ext/apex_src/Package.swift +160 -0
- data/ext/apex_ext/apex_src/PackageSupport/README.md +17 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_export.h +20 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_version.h +14 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +4 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/config.h +41 -0
- data/ext/apex_ext/apex_src/README.md +452 -0
- data/ext/apex_ext/apex_src/VERSION +1 -0
- data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
- data/ext/apex_ext/apex_src/apex-plugins.json.example +20 -0
- data/ext/apex_ext/apex_src/apex.pc.in +11 -0
- data/ext/apex_ext/apex_src/cli/main.c +2720 -0
- data/ext/apex_ext/apex_src/debug_test.sh +22 -0
- data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +451 -0
- data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +166 -0
- data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +220 -0
- data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +501 -0
- data/ext/apex_ext/apex_src/docs/DEBUGGING.md +73 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +391 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +237 -0
- data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +456 -0
- data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +210 -0
- data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +344 -0
- data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +144 -0
- data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +278 -0
- data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +321 -0
- data/ext/apex_ext/apex_src/docs/PROGRESS.md +167 -0
- data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +174 -0
- data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +243 -0
- data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +316 -0
- data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +803 -0
- data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +91 -0
- data/ext/apex_ext/apex_src/documentation/README.md +160 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +365 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +24 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +1737 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +1420 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3574 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +1603 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +910 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +1003 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +1308 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +1078 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +1622 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +1698 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +1531 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +1980 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +1368 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +1151 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +2861 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +3981 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +1454 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +1200 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +2066 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +22 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +914 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +399 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +772 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +678 -0
- data/ext/apex_ext/apex_src/documentation/generate_docset.rb +873 -0
- data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +733 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +17073 -0
- data/ext/apex_ext/apex_src/documentation/shared_scripts.js +64 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +646 -0
- data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +260 -0
- data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +119 -0
- data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +11 -0
- data/ext/apex_ext/apex_src/examples/example.html +53 -0
- data/ext/apex_ext/apex_src/examples/example.md +85 -0
- data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +158 -0
- data/ext/apex_ext/apex_src/examples/kbd.md +8 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +250 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +9 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +247 -0
- data/ext/apex_ext/apex_src/include/apex/buffer.h +93 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +16 -0
- data/ext/apex_ext/apex_src/include/apex/parser.h +150 -0
- data/ext/apex_ext/apex_src/include/apex/renderer.h +39 -0
- data/ext/apex_ext/apex_src/man/apex-config.5 +374 -0
- data/ext/apex_ext/apex_src/man/apex-config.5.md +260 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7 +456 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7.md +365 -0
- data/ext/apex_ext/apex_src/man/apex.1 +828 -0
- data/ext/apex_ext/apex_src/man/apex.1.md +643 -0
- data/ext/apex_ext/apex_src/man/apex.1.new +338 -0
- data/ext/apex_ext/apex_src/objc/Apex.swift +237 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +117 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +332 -0
- data/ext/apex_ext/apex_src/src/_README.md +358 -0
- data/ext/apex_ext/apex_src/src/apex.c +6326 -0
- data/ext/apex_ext/apex_src/src/buffer.c +93 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +362 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.h +45 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.c +184 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.h +50 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +1897 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +215 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +53 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.c +2042 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.h +163 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.c +329 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.h +48 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +1670 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.c +710 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.h +38 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji_data.h +942 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.c +925 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.h +43 -0
- data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +869 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1121 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.h +33 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.c +626 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.h +60 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.c +135 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +408 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.c +4084 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.h +145 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.c +1536 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.h +54 -0
- data/ext/apex_ext/apex_src/src/extensions/index.c +967 -0
- data/ext/apex_ext/apex_src/src/extensions/index.h +90 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +205 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.c +332 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.h +13 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.c +248 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.h +18 -0
- data/ext/apex_ext/apex_src/src/extensions/math.c +279 -0
- data/ext/apex_ext/apex_src/src/extensions/math.h +32 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +3046 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.h +125 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +1297 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.h +39 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +194 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.h +29 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +405 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +468 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +44 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +2679 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.c +255 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.h +58 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +2762 -0
- data/ext/apex_ext/apex_src/src/html_renderer.h +126 -0
- data/ext/apex_ext/apex_src/src/parser.c +227 -0
- data/ext/apex_ext/apex_src/src/plugins.c +895 -0
- data/ext/apex_ext/apex_src/src/plugins.h +39 -0
- data/ext/apex_ext/apex_src/src/plugins_env.c +187 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +263 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +358 -0
- data/ext/apex_ext/apex_src/src/renderer.c +241 -0
- data/ext/apex_ext/apex_src/src/utf8.c +56 -0
- data/ext/apex_ext/apex_src/test-linux-build.sh +20 -0
- data/ext/apex_ext/apex_src/test.html +103 -0
- data/ext/apex_ext/apex_src/test_coverage.sh +121 -0
- data/ext/apex_ext/apex_src/test_ial_fenced.md +6 -0
- data/ext/apex_ext/apex_src/test_math_norm.py +79 -0
- data/ext/apex_ext/apex_src/test_pandoc_output.html +48 -0
- data/ext/apex_ext/apex_src/test_spm.sh +107 -0
- data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +50 -0
- data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +229 -0
- data/ext/apex_ext/apex_src/tests/CMakeLists.txt +24 -0
- data/ext/apex_ext/apex_src/tests/README.md +146 -0
- data/ext/apex_ext/apex_src/tests/benchmark.sh +113 -0
- data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +166 -0
- data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +31 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +25 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +24 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +33 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +26 -0
- data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +260 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +6 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +9 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +620 -0
- data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +177 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +74 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +60 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +16 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +1094 -0
- data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +96 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +43 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +53 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +37 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +93 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +38 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +15 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +15 -0
- data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +105 -0
- data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +143 -0
- data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +96 -0
- data/ext/apex_ext/apex_src/tests/gh_api_test.md +6 -0
- data/ext/apex_ext/apex_src/tests/ial_demo.html +186 -0
- data/ext/apex_ext/apex_src/tests/include_code.py +19 -0
- data/ext/apex_ext/apex_src/tests/include_snippet.md +15 -0
- data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +64 -0
- data/ext/apex_ext/apex_src/tests/sample_data.csv +7 -0
- data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +4 -0
- data/ext/apex_ext/apex_src/tests/test_basic.c +74 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +2116 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.c +183 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.h +91 -0
- data/ext/apex_ext/apex_src/tests/test_ial.c +282 -0
- data/ext/apex_ext/apex_src/tests/test_links.c +418 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +265 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +908 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +1118 -0
- data/ext/apex_ext/apex_src/tests/test_plugins.c +219 -0
- data/ext/apex_ext/apex_src/tests/test_refs.bib +31 -0
- data/ext/apex_ext/apex_src/tests/test_runner.c +244 -0
- data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +198 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +862 -0
- data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +9 -0
- data/ext/apex_ext/apex_src/tests/yaml_test.md +13 -0
- data/ext/apex_ext/apex_src/tests.rb +39 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +48 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/COPYING +170 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +74 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +206 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +30 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +111 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +1169 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +21 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +3 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +23 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +18 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +595 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +19 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +1245 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +1495 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +119 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +508 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/cmark-gfm-core-extensions.h +54 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/core-extensions.c +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.c +879 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +92 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.c +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.h +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +917 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.h +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.c +60 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.c +156 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +91 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +110 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +28 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +133 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +78 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +1041 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +1 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +230 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/arena.c +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +1622 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.c +278 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.h +116 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/case_fold_switch.inc +4327 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/chunk.h +135 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm-extension_api.h +737 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm.h +833 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +7 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark.c +55 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.c +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.h +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/commonmark.c +514 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +76 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/entities.inc +2138 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini.h +57 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_href_e.c +100 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_e.c +66 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_u.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.c +502 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.c +1788 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.h +29 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.c +159 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/latex.c +468 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/linked_list.c +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +328 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/man.c +274 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.c +129 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.h +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.c +1045 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.h +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/parser.h +59 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plaintext.c +218 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.c +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.c +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.c +213 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.h +62 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.c +14056 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.h +70 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +365 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.c +317 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/xml.c +182 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +114 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +49 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +58 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +105 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +920 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +194 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +160 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +375 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +50 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +4 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +177 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +10212 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +152 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +41 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +319 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +80 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +6 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +208 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +109 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +160 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Changes +372 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/License +20 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +51 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +46 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +89 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +73 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +222 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +24 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +14 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +1999 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +77 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +32 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +23 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +1393 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +394 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +2358 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +544 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +1416 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +469 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +3598 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +141 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +684 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +27 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +9 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +800 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +1127 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +217 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +202 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +314 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +290 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +327 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +196 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +88 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +354 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +16 -0
- data/ext/apex_ext/extconf.rb +103 -0
- data/lib/apex/configurable.rb +46 -0
- data/lib/apex/document.rb +66 -0
- data/lib/apex/version.rb +15 -0
- data/lib/apex.rb +28 -0
- metadata +544 -0
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
#include "plugins.h"
|
|
2
|
+
#include "extensions/metadata.h"
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <string.h>
|
|
5
|
+
#include <dirent.h>
|
|
6
|
+
#include <sys/stat.h>
|
|
7
|
+
#include <unistd.h>
|
|
8
|
+
#include <errno.h>
|
|
9
|
+
#include <regex.h>
|
|
10
|
+
#include <sys/time.h>
|
|
11
|
+
#include <stdio.h>
|
|
12
|
+
|
|
13
|
+
#ifdef APEX_HAVE_LIBYAML
|
|
14
|
+
#include <yaml.h>
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
/* External command runner for plugins (from plugins_env.c) */
|
|
18
|
+
char *apex_run_external_plugin_command(const char *cmd,
|
|
19
|
+
const char *phase,
|
|
20
|
+
const char *plugin_id,
|
|
21
|
+
const char *text,
|
|
22
|
+
int timeout_ms);
|
|
23
|
+
|
|
24
|
+
/* ------------------------------------------------------------------------- */
|
|
25
|
+
/* Profiling helpers */
|
|
26
|
+
/* */
|
|
27
|
+
/* Plugin profiling is controlled by environment variables: */
|
|
28
|
+
/* - APEX_PROFILE_PLUGINS: if set to 1/yes/true, enables plugin profiling */
|
|
29
|
+
/* - otherwise, falls back to APEX_PROFILE (same flag used in apex.c) */
|
|
30
|
+
/* */
|
|
31
|
+
/* When enabled, we emit timing for each plugin invocation and for the */
|
|
32
|
+
/* overall phase run (pre_parse/post_render). Output goes to stderr. */
|
|
33
|
+
/* ------------------------------------------------------------------------- */
|
|
34
|
+
|
|
35
|
+
static int apex_plugins_profiling_enabled(void) {
|
|
36
|
+
const char *env = getenv("APEX_PROFILE_PLUGINS");
|
|
37
|
+
if (!env || !*env) {
|
|
38
|
+
env = getenv("APEX_PROFILE");
|
|
39
|
+
}
|
|
40
|
+
if (!env) return 0;
|
|
41
|
+
return (strcmp(env, "1") == 0 ||
|
|
42
|
+
strcmp(env, "yes") == 0 ||
|
|
43
|
+
strcmp(env, "true") == 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static double apex_plugins_time_ms(void) {
|
|
47
|
+
struct timeval tv;
|
|
48
|
+
gettimeofday(&tv, NULL);
|
|
49
|
+
return tv.tv_sec * 1000.0 + tv.tv_usec / 1000.0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ------------------------------------------------------------------------- */
|
|
53
|
+
/* Git helpers */
|
|
54
|
+
/* */
|
|
55
|
+
/* When running inside a Git repository, we optionally consult the repo's */
|
|
56
|
+
/* top-level directory for a project-scoped `.apex/plugins` directory. */
|
|
57
|
+
/* */
|
|
58
|
+
/* This is deliberately best-effort: if Git is unavailable or the current */
|
|
59
|
+
/* directory is not inside a work tree, we simply skip this step. */
|
|
60
|
+
/* ------------------------------------------------------------------------- */
|
|
61
|
+
|
|
62
|
+
static char *apex_git_toplevel(void) {
|
|
63
|
+
/* Suppress stderr from git so we don't spam users when not in a repo. */
|
|
64
|
+
FILE *fp = popen("git rev-parse --show-toplevel 2>/dev/null", "r");
|
|
65
|
+
if (!fp) {
|
|
66
|
+
return NULL;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
char buf[1024];
|
|
70
|
+
if (!fgets(buf, sizeof(buf), fp)) {
|
|
71
|
+
pclose(fp);
|
|
72
|
+
return NULL;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
int rc = pclose(fp);
|
|
76
|
+
if (rc != 0) {
|
|
77
|
+
return NULL;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Strip trailing newline(s). */
|
|
81
|
+
size_t len = strlen(buf);
|
|
82
|
+
while (len > 0 && (buf[len - 1] == '\n' || buf[len - 1] == '\r')) {
|
|
83
|
+
buf[--len] = '\0';
|
|
84
|
+
}
|
|
85
|
+
if (len == 0) {
|
|
86
|
+
return NULL;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
char *out = malloc(len + 1);
|
|
90
|
+
if (!out) return NULL;
|
|
91
|
+
memcpy(out, buf, len + 1);
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
struct apex_plugin {
|
|
96
|
+
char *id;
|
|
97
|
+
char *title;
|
|
98
|
+
char *author;
|
|
99
|
+
char *description;
|
|
100
|
+
char *homepage;
|
|
101
|
+
char *repo;
|
|
102
|
+
apex_plugin_phase_mask phases;
|
|
103
|
+
int priority;
|
|
104
|
+
char *handler_command;
|
|
105
|
+
int timeout_ms;
|
|
106
|
+
/* Declarative regex support */
|
|
107
|
+
char *pattern;
|
|
108
|
+
char *replacement;
|
|
109
|
+
regex_t regex;
|
|
110
|
+
int has_regex;
|
|
111
|
+
/* Owning directory for this plugin (used for APEX_PLUGIN_DIR) */
|
|
112
|
+
char *dir_path;
|
|
113
|
+
/* Per-plugin support directory (used for APEX_SUPPORT_DIR) */
|
|
114
|
+
char *support_dir;
|
|
115
|
+
struct apex_plugin *next;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
struct apex_plugin_manager {
|
|
119
|
+
struct apex_plugin *pre_parse;
|
|
120
|
+
struct apex_plugin *post_render;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
static void free_plugin(struct apex_plugin *p) {
|
|
124
|
+
while (p) {
|
|
125
|
+
struct apex_plugin *next = p->next;
|
|
126
|
+
free(p->id);
|
|
127
|
+
free(p->title);
|
|
128
|
+
free(p->author);
|
|
129
|
+
free(p->description);
|
|
130
|
+
free(p->homepage);
|
|
131
|
+
free(p->repo);
|
|
132
|
+
free(p->handler_command);
|
|
133
|
+
free(p->pattern);
|
|
134
|
+
free(p->replacement);
|
|
135
|
+
free(p->dir_path);
|
|
136
|
+
free(p->support_dir);
|
|
137
|
+
if (p->has_regex) {
|
|
138
|
+
regfree(&p->regex);
|
|
139
|
+
}
|
|
140
|
+
free(p);
|
|
141
|
+
p = next;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
void apex_plugins_free(apex_plugin_manager *manager) {
|
|
146
|
+
if (!manager) return;
|
|
147
|
+
free_plugin(manager->pre_parse);
|
|
148
|
+
free_plugin(manager->post_render);
|
|
149
|
+
free(manager);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
static int plugin_phase_mask_from_string(const char *phase) {
|
|
153
|
+
if (!phase) return 0;
|
|
154
|
+
if (strcmp(phase, "pre_parse") == 0) return APEX_PLUGIN_PHASE_PRE_PARSE;
|
|
155
|
+
if (strcmp(phase, "block") == 0) return APEX_PLUGIN_PHASE_BLOCK;
|
|
156
|
+
if (strcmp(phase, "inline") == 0) return APEX_PLUGIN_PHASE_INLINE;
|
|
157
|
+
if (strcmp(phase, "post_render") == 0) return APEX_PLUGIN_PHASE_POST_RENDER;
|
|
158
|
+
return 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static int read_file_into_buffer(const char *path, char **out) {
|
|
162
|
+
*out = NULL;
|
|
163
|
+
FILE *fp = fopen(path, "rb");
|
|
164
|
+
if (!fp) return -1;
|
|
165
|
+
if (fseek(fp, 0, SEEK_END) != 0) { fclose(fp); return -1; }
|
|
166
|
+
long sz = ftell(fp);
|
|
167
|
+
if (sz < 0) { fclose(fp); return -1; }
|
|
168
|
+
if (fseek(fp, 0, SEEK_SET) != 0) { fclose(fp); return -1; }
|
|
169
|
+
char *buf = malloc((size_t)sz + 1);
|
|
170
|
+
if (!buf) { fclose(fp); return -1; }
|
|
171
|
+
size_t n = fread(buf, 1, (size_t)sz, fp);
|
|
172
|
+
fclose(fp);
|
|
173
|
+
buf[n] = '\0';
|
|
174
|
+
*out = buf;
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static bool file_has_yaml_front_matter(const char *path) {
|
|
179
|
+
char *buf = NULL;
|
|
180
|
+
if (read_file_into_buffer(path, &buf) != 0 || !buf) return false;
|
|
181
|
+
bool result = (strncmp(buf, "---", 3) == 0);
|
|
182
|
+
free(buf);
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
static void append_plugin_sorted(struct apex_plugin **head, struct apex_plugin *p) {
|
|
187
|
+
if (!p) return;
|
|
188
|
+
if (!*head || (*head)->priority > p->priority ||
|
|
189
|
+
((*head)->priority == p->priority &&
|
|
190
|
+
strcmp((*head)->id ? (*head)->id : "", p->id ? p->id : "") > 0)) {
|
|
191
|
+
p->next = *head;
|
|
192
|
+
*head = p;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
struct apex_plugin *cur = *head;
|
|
196
|
+
while (cur->next &&
|
|
197
|
+
(cur->next->priority < p->priority ||
|
|
198
|
+
(cur->next->priority == p->priority &&
|
|
199
|
+
strcmp(cur->next->id ? cur->next->id : "", p->id ? p->id : "") <= 0))) {
|
|
200
|
+
cur = cur->next;
|
|
201
|
+
}
|
|
202
|
+
p->next = cur->next;
|
|
203
|
+
cur->next = p;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static bool plugin_id_exists(struct apex_plugin *head, const char *id) {
|
|
207
|
+
if (!id) return false;
|
|
208
|
+
for (struct apex_plugin *p = head; p; p = p->next) {
|
|
209
|
+
if (p->id && strcmp(p->id, id) == 0) return true;
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Determine base support directory for plugins, creating it if needed.
|
|
215
|
+
* This follows XDG conventions: $XDG_CONFIG_HOME/apex/support or
|
|
216
|
+
* $HOME/.config/apex/support.
|
|
217
|
+
*/
|
|
218
|
+
static char *apex_get_support_base_dir(void) {
|
|
219
|
+
const char *xdg = getenv("XDG_CONFIG_HOME");
|
|
220
|
+
char buf[1024];
|
|
221
|
+
|
|
222
|
+
if (xdg && *xdg) {
|
|
223
|
+
snprintf(buf, sizeof(buf), "%s/apex/support", xdg);
|
|
224
|
+
} else {
|
|
225
|
+
const char *home = getenv("HOME");
|
|
226
|
+
if (!home || !*home) {
|
|
227
|
+
return NULL;
|
|
228
|
+
}
|
|
229
|
+
snprintf(buf, sizeof(buf), "%s/.config/apex/support", home);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Ensure directory exists (mkdir -p style for two levels) */
|
|
233
|
+
char *path = strdup(buf);
|
|
234
|
+
if (!path) return NULL;
|
|
235
|
+
|
|
236
|
+
/* Create parent ~/.config/apex if needed when using HOME path */
|
|
237
|
+
if (!xdg || !*xdg) {
|
|
238
|
+
char parent[1024];
|
|
239
|
+
snprintf(parent, sizeof(parent), "%s/.config/apex", getenv("HOME"));
|
|
240
|
+
mkdir(parent, 0700);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
mkdir(path, 0700);
|
|
244
|
+
return path;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
static void load_plugins_from_dir(apex_plugin_manager *manager,
|
|
248
|
+
const char *dirpath) {
|
|
249
|
+
if (!manager || !dirpath) return;
|
|
250
|
+
DIR *dir = opendir(dirpath);
|
|
251
|
+
if (!dir) return;
|
|
252
|
+
|
|
253
|
+
char *support_base = apex_get_support_base_dir();
|
|
254
|
+
|
|
255
|
+
struct dirent *ent;
|
|
256
|
+
while ((ent = readdir(dir)) != NULL) {
|
|
257
|
+
if (ent->d_name[0] == '.') continue;
|
|
258
|
+
|
|
259
|
+
char plugin_dir[1024];
|
|
260
|
+
snprintf(plugin_dir, sizeof(plugin_dir), "%s/%s", dirpath, ent->d_name);
|
|
261
|
+
|
|
262
|
+
struct stat st;
|
|
263
|
+
if (stat(plugin_dir, &st) != 0) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
char manifest_path[1024];
|
|
268
|
+
if (S_ISDIR(st.st_mode)) {
|
|
269
|
+
/* New style: each subdirectory is a plugin, with plugin.yml/yaml */
|
|
270
|
+
snprintf(manifest_path, sizeof(manifest_path), "%s/plugin.yml", plugin_dir);
|
|
271
|
+
if (!file_has_yaml_front_matter(manifest_path)) {
|
|
272
|
+
snprintf(manifest_path, sizeof(manifest_path), "%s/plugin.yaml", plugin_dir);
|
|
273
|
+
if (!file_has_yaml_front_matter(manifest_path)) {
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
/* Backwards compatibility: flat *.yml / *.yaml manifests */
|
|
279
|
+
size_t len = strlen(ent->d_name);
|
|
280
|
+
if (!( (len > 4 && strcmp(ent->d_name + len - 4, ".yml") == 0) ||
|
|
281
|
+
(len > 5 && strcmp(ent->d_name + len - 5, ".yaml") == 0))) {
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (!file_has_yaml_front_matter(plugin_dir)) {
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
snprintf(manifest_path, sizeof(manifest_path), "%s", plugin_dir);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
apex_metadata_item *meta = apex_load_metadata_from_file(manifest_path);
|
|
291
|
+
if (!meta) continue;
|
|
292
|
+
|
|
293
|
+
#ifdef APEX_HAVE_LIBYAML
|
|
294
|
+
/* Check for bundle array - if found, process each bundle entry as a separate plugin */
|
|
295
|
+
size_t bundle_count = 0;
|
|
296
|
+
apex_metadata_item **bundles = apex_extract_plugin_bundle(manifest_path, &bundle_count);
|
|
297
|
+
if (bundles && bundle_count > 0) {
|
|
298
|
+
/* Process each bundle entry as a plugin */
|
|
299
|
+
for (size_t b_idx = 0; b_idx < bundle_count; b_idx++) {
|
|
300
|
+
apex_metadata_item *bundle_meta = bundles[b_idx];
|
|
301
|
+
if (!bundle_meta) continue;
|
|
302
|
+
|
|
303
|
+
/* Merge bundle-level metadata (from top-level) with bundle entry metadata */
|
|
304
|
+
/* Bundle entry metadata takes precedence */
|
|
305
|
+
apex_metadata_item *merged = apex_merge_metadata(meta, bundle_meta, NULL);
|
|
306
|
+
|
|
307
|
+
/* Extract plugin fields from merged metadata */
|
|
308
|
+
const char *id = NULL;
|
|
309
|
+
const char *title = NULL;
|
|
310
|
+
const char *author = NULL;
|
|
311
|
+
const char *description = NULL;
|
|
312
|
+
const char *phase = NULL;
|
|
313
|
+
const char *handler_command = NULL;
|
|
314
|
+
const char *priority_str = NULL;
|
|
315
|
+
const char *timeout_str = NULL;
|
|
316
|
+
const char *pattern_str = NULL;
|
|
317
|
+
const char *replacement_str = NULL;
|
|
318
|
+
const char *flags_str = NULL;
|
|
319
|
+
const char *homepage = NULL;
|
|
320
|
+
const char *repo = NULL;
|
|
321
|
+
|
|
322
|
+
/* First, get bundle-level metadata (from top-level meta) */
|
|
323
|
+
for (apex_metadata_item *m = meta; m; m = m->next) {
|
|
324
|
+
if (strcmp(m->key, "author") == 0) author = m->value;
|
|
325
|
+
else if (strcmp(m->key, "homepage") == 0) homepage = m->value;
|
|
326
|
+
else if (strcmp(m->key, "repo") == 0) repo = m->value;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Then, get bundle entry-specific metadata (overrides bundle-level) */
|
|
330
|
+
for (apex_metadata_item *m = merged; m; m = m->next) {
|
|
331
|
+
if (strcmp(m->key, "id") == 0) id = m->value;
|
|
332
|
+
else if (strcmp(m->key, "title") == 0) title = m->value;
|
|
333
|
+
else if (strcmp(m->key, "author") == 0 && m->value) author = m->value;
|
|
334
|
+
else if (strcmp(m->key, "description") == 0) description = m->value;
|
|
335
|
+
else if (strcmp(m->key, "homepage") == 0 && m->value) homepage = m->value;
|
|
336
|
+
else if (strcmp(m->key, "repo") == 0 && m->value) repo = m->value;
|
|
337
|
+
else if (strcmp(m->key, "phase") == 0) phase = m->value;
|
|
338
|
+
else if (strcmp(m->key, "handler.command") == 0) handler_command = m->value;
|
|
339
|
+
else if (strcmp(m->key, "handler_command") == 0) handler_command = m->value;
|
|
340
|
+
else if (strcmp(m->key, "priority") == 0) priority_str = m->value;
|
|
341
|
+
else if (strcmp(m->key, "timeout_ms") == 0) timeout_str = m->value;
|
|
342
|
+
else if (strcmp(m->key, "pattern") == 0) pattern_str = m->value;
|
|
343
|
+
else if (strcmp(m->key, "replacement") == 0) replacement_str = m->value;
|
|
344
|
+
else if (strcmp(m->key, "flags") == 0) flags_str = m->value;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (!id || !phase) {
|
|
348
|
+
apex_free_metadata(merged);
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
int phase_mask = plugin_phase_mask_from_string(phase);
|
|
353
|
+
if (!(phase_mask & (APEX_PLUGIN_PHASE_PRE_PARSE | APEX_PLUGIN_PHASE_POST_RENDER))) {
|
|
354
|
+
apex_free_metadata(merged);
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
struct apex_plugin *p = calloc(1, sizeof(struct apex_plugin));
|
|
359
|
+
if (!p) {
|
|
360
|
+
apex_free_metadata(merged);
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
p->id = strdup(id);
|
|
364
|
+
p->title = title ? strdup(title) : NULL;
|
|
365
|
+
p->author = author ? strdup(author) : NULL;
|
|
366
|
+
p->description = description ? strdup(description) : NULL;
|
|
367
|
+
p->homepage = homepage ? strdup(homepage) : NULL;
|
|
368
|
+
p->repo = repo ? strdup(repo) : NULL;
|
|
369
|
+
p->phases = phase_mask;
|
|
370
|
+
p->handler_command = handler_command ? strdup(handler_command) : NULL;
|
|
371
|
+
p->priority = priority_str ? atoi(priority_str) : 100;
|
|
372
|
+
p->timeout_ms = timeout_str ? atoi(timeout_str) : 0;
|
|
373
|
+
p->has_regex = 0;
|
|
374
|
+
p->dir_path = strdup(plugin_dir);
|
|
375
|
+
|
|
376
|
+
/* Compute per-plugin support directory */
|
|
377
|
+
char *support_base = apex_get_support_base_dir();
|
|
378
|
+
if (support_base && id) {
|
|
379
|
+
char supp[1024];
|
|
380
|
+
snprintf(supp, sizeof(supp), "%s/%s", support_base, id);
|
|
381
|
+
mkdir(supp, 0700);
|
|
382
|
+
p->support_dir = strdup(supp);
|
|
383
|
+
}
|
|
384
|
+
if (support_base) free(support_base);
|
|
385
|
+
|
|
386
|
+
/* Compile declarative regex if provided */
|
|
387
|
+
if (!p->handler_command && pattern_str && replacement_str) {
|
|
388
|
+
int cflags = REG_EXTENDED;
|
|
389
|
+
if (flags_str && strchr(flags_str, 'i')) {
|
|
390
|
+
cflags |= REG_ICASE;
|
|
391
|
+
}
|
|
392
|
+
if (regcomp(&p->regex, pattern_str, cflags) != 0) {
|
|
393
|
+
free(p->id);
|
|
394
|
+
free(p->title);
|
|
395
|
+
free(p->author);
|
|
396
|
+
free(p->description);
|
|
397
|
+
free(p->homepage);
|
|
398
|
+
free(p->repo);
|
|
399
|
+
free(p);
|
|
400
|
+
apex_free_metadata(merged);
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
p->pattern = strdup(pattern_str);
|
|
404
|
+
p->replacement = strdup(replacement_str);
|
|
405
|
+
p->has_regex = 1;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Attach to appropriate phase lists */
|
|
409
|
+
if (phase_mask & APEX_PLUGIN_PHASE_PRE_PARSE) {
|
|
410
|
+
if (!plugin_id_exists(manager->pre_parse, id)) {
|
|
411
|
+
append_plugin_sorted(&manager->pre_parse, p);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (phase_mask & APEX_PLUGIN_PHASE_POST_RENDER) {
|
|
415
|
+
if (!plugin_id_exists(manager->post_render, id)) {
|
|
416
|
+
append_plugin_sorted(&manager->post_render, p);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
apex_free_metadata(merged);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/* Free bundle arrays */
|
|
424
|
+
for (size_t b_idx = 0; b_idx < bundle_count; b_idx++) {
|
|
425
|
+
if (bundles[b_idx]) {
|
|
426
|
+
apex_free_metadata(bundles[b_idx]);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
free(bundles);
|
|
430
|
+
apex_free_metadata(meta);
|
|
431
|
+
continue; /* Skip single-plugin processing for bundle manifests */
|
|
432
|
+
}
|
|
433
|
+
if (bundles) {
|
|
434
|
+
free(bundles);
|
|
435
|
+
}
|
|
436
|
+
#endif
|
|
437
|
+
|
|
438
|
+
const char *id = NULL;
|
|
439
|
+
const char *title = NULL;
|
|
440
|
+
const char *author = NULL;
|
|
441
|
+
const char *description = NULL;
|
|
442
|
+
const char *phase = NULL;
|
|
443
|
+
const char *handler_command = NULL;
|
|
444
|
+
const char *priority_str = NULL;
|
|
445
|
+
const char *timeout_str = NULL;
|
|
446
|
+
const char *pattern_str = NULL;
|
|
447
|
+
const char *replacement_str = NULL;
|
|
448
|
+
const char *flags_str = NULL;
|
|
449
|
+
const char *homepage = NULL;
|
|
450
|
+
const char *repo = NULL;
|
|
451
|
+
|
|
452
|
+
for (apex_metadata_item *m = meta; m; m = m->next) {
|
|
453
|
+
if (strcmp(m->key, "id") == 0) id = m->value;
|
|
454
|
+
else if (strcmp(m->key, "title") == 0) title = m->value;
|
|
455
|
+
else if (strcmp(m->key, "author") == 0) author = m->value;
|
|
456
|
+
else if (strcmp(m->key, "description") == 0) description = m->value;
|
|
457
|
+
else if (strcmp(m->key, "homepage") == 0) homepage = m->value;
|
|
458
|
+
else if (strcmp(m->key, "repo") == 0) repo = m->value;
|
|
459
|
+
else if (strcmp(m->key, "phase") == 0) phase = m->value;
|
|
460
|
+
else if (strcmp(m->key, "handler.command") == 0) handler_command = m->value;
|
|
461
|
+
else if (strcmp(m->key, "handler_command") == 0) handler_command = m->value;
|
|
462
|
+
else if (strcmp(m->key, "priority") == 0) priority_str = m->value;
|
|
463
|
+
else if (strcmp(m->key, "timeout_ms") == 0) timeout_str = m->value;
|
|
464
|
+
else if (strcmp(m->key, "pattern") == 0) pattern_str = m->value;
|
|
465
|
+
else if (strcmp(m->key, "replacement") == 0) replacement_str = m->value;
|
|
466
|
+
else if (strcmp(m->key, "flags") == 0) flags_str = m->value;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (!phase) {
|
|
470
|
+
apex_free_metadata(meta);
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
int phase_mask = plugin_phase_mask_from_string(phase);
|
|
475
|
+
if (!(phase_mask & (APEX_PLUGIN_PHASE_PRE_PARSE | APEX_PLUGIN_PHASE_POST_RENDER))) {
|
|
476
|
+
apex_free_metadata(meta);
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const char *final_id = id ? id : ent->d_name;
|
|
481
|
+
struct apex_plugin *p = calloc(1, sizeof(struct apex_plugin));
|
|
482
|
+
if (!p) {
|
|
483
|
+
apex_free_metadata(meta);
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
p->id = final_id ? strdup(final_id) : NULL;
|
|
487
|
+
p->title = title ? strdup(title) : NULL;
|
|
488
|
+
p->author = author ? strdup(author) : NULL;
|
|
489
|
+
p->description = description ? strdup(description) : NULL;
|
|
490
|
+
p->homepage = homepage ? strdup(homepage) : NULL;
|
|
491
|
+
p->repo = repo ? strdup(repo) : NULL;
|
|
492
|
+
p->phases = phase_mask;
|
|
493
|
+
p->handler_command = handler_command ? strdup(handler_command) : NULL;
|
|
494
|
+
p->priority = priority_str ? atoi(priority_str) : 100;
|
|
495
|
+
p->timeout_ms = timeout_str ? atoi(timeout_str) : 0;
|
|
496
|
+
p->has_regex = 0;
|
|
497
|
+
p->dir_path = strdup(S_ISDIR(st.st_mode) ? plugin_dir : dirpath);
|
|
498
|
+
|
|
499
|
+
/* Compute per-plugin support directory, if we have a base and id */
|
|
500
|
+
if (support_base && final_id) {
|
|
501
|
+
char supp[1024];
|
|
502
|
+
snprintf(supp, sizeof(supp), "%s/%s", support_base, final_id);
|
|
503
|
+
mkdir(supp, 0700);
|
|
504
|
+
p->support_dir = strdup(supp);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/* Compile declarative regex if provided and no external handler */
|
|
508
|
+
if (!p->handler_command && pattern_str && replacement_str) {
|
|
509
|
+
int cflags = REG_EXTENDED;
|
|
510
|
+
if (flags_str && strchr(flags_str, 'i')) {
|
|
511
|
+
cflags |= REG_ICASE;
|
|
512
|
+
}
|
|
513
|
+
if (regcomp(&p->regex, pattern_str, cflags) != 0) {
|
|
514
|
+
/* Invalid regex, skip this plugin */
|
|
515
|
+
free(p->id);
|
|
516
|
+
free(p->title);
|
|
517
|
+
free(p->author);
|
|
518
|
+
free(p->description);
|
|
519
|
+
free(p->homepage);
|
|
520
|
+
free(p->repo);
|
|
521
|
+
free(p);
|
|
522
|
+
apex_free_metadata(meta);
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
p->pattern = strdup(pattern_str);
|
|
526
|
+
p->replacement = strdup(replacement_str);
|
|
527
|
+
p->has_regex = 1;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/* Attach to appropriate phase lists, enforcing per-list id uniqueness */
|
|
531
|
+
if (phase_mask & APEX_PLUGIN_PHASE_PRE_PARSE) {
|
|
532
|
+
if (!plugin_id_exists(manager->pre_parse, final_id)) {
|
|
533
|
+
append_plugin_sorted(&manager->pre_parse, p);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (phase_mask & APEX_PLUGIN_PHASE_POST_RENDER) {
|
|
537
|
+
if (!plugin_id_exists(manager->post_render, final_id)) {
|
|
538
|
+
append_plugin_sorted(&manager->post_render, p);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
apex_free_metadata(meta);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (support_base) free(support_base);
|
|
546
|
+
closedir(dir);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
static char *dup_join(const char *a, const char *b) {
|
|
550
|
+
size_t la = a ? strlen(a) : 0;
|
|
551
|
+
size_t lb = b ? strlen(b) : 0;
|
|
552
|
+
char *res = malloc(la + lb + 2);
|
|
553
|
+
if (!res) return NULL;
|
|
554
|
+
if (la) memcpy(res, a, la);
|
|
555
|
+
if (lb) {
|
|
556
|
+
if (la) res[la] = '/';
|
|
557
|
+
memcpy(res + la + (la ? 1 : 0), b, lb);
|
|
558
|
+
res[la + (la ? 1 : 0) + lb] = '\0';
|
|
559
|
+
} else {
|
|
560
|
+
res[la] = '\0';
|
|
561
|
+
}
|
|
562
|
+
return res;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
apex_plugin_manager *apex_plugins_load(const apex_options *options) {
|
|
566
|
+
if (!options || !options->enable_plugins) return NULL;
|
|
567
|
+
|
|
568
|
+
apex_plugin_manager *manager = calloc(1, sizeof(apex_plugin_manager));
|
|
569
|
+
if (!manager) return NULL;
|
|
570
|
+
|
|
571
|
+
/* Project-scoped (current working directory): CWD/.apex/plugins */
|
|
572
|
+
char cwd[1024];
|
|
573
|
+
cwd[0] = '\0';
|
|
574
|
+
if (getcwd(cwd, sizeof(cwd)) != NULL && cwd[0] != '\0') {
|
|
575
|
+
char *cwd_proj_dir = dup_join(cwd, ".apex/plugins");
|
|
576
|
+
if (cwd_proj_dir) {
|
|
577
|
+
load_plugins_from_dir(manager, cwd_proj_dir);
|
|
578
|
+
free(cwd_proj_dir);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/* Project-scoped (explicit base_directory): base_directory/.apex/plugins */
|
|
583
|
+
if (options->base_directory && options->base_directory[0] != '\0') {
|
|
584
|
+
char *proj_dir = dup_join(options->base_directory, ".apex/plugins");
|
|
585
|
+
if (proj_dir) {
|
|
586
|
+
load_plugins_from_dir(manager, proj_dir);
|
|
587
|
+
free(proj_dir);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/* Project-scoped (Git repository root): <git top>/\.apex/plugins
|
|
592
|
+
* Only used when the current directory is inside the work tree.
|
|
593
|
+
*/
|
|
594
|
+
char *git_root = apex_git_toplevel();
|
|
595
|
+
if (git_root && git_root[0] != '\0' && cwd[0] != '\0') {
|
|
596
|
+
size_t root_len = strlen(git_root);
|
|
597
|
+
/* Ensure the Git root is a parent of (or equal to) the current directory. */
|
|
598
|
+
if (strncmp(cwd, git_root, root_len) == 0 &&
|
|
599
|
+
(cwd[root_len] == '/' || cwd[root_len] == '\0')) {
|
|
600
|
+
/* Avoid re-loading if git_root is the same as base_directory. */
|
|
601
|
+
if (!options->base_directory ||
|
|
602
|
+
strcmp(git_root, options->base_directory) != 0) {
|
|
603
|
+
char *git_proj_dir = dup_join(git_root, ".apex/plugins");
|
|
604
|
+
if (git_proj_dir) {
|
|
605
|
+
load_plugins_from_dir(manager, git_proj_dir);
|
|
606
|
+
free(git_proj_dir);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
free(git_root);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* User-global: $XDG_CONFIG_HOME/apex/plugins or $HOME/.config/apex/plugins */
|
|
614
|
+
const char *xdg = getenv("XDG_CONFIG_HOME");
|
|
615
|
+
char *global_dir = NULL;
|
|
616
|
+
if (xdg && *xdg) {
|
|
617
|
+
char buf[1024];
|
|
618
|
+
snprintf(buf, sizeof(buf), "%s/apex/plugins", xdg);
|
|
619
|
+
global_dir = strdup(buf);
|
|
620
|
+
} else {
|
|
621
|
+
const char *home = getenv("HOME");
|
|
622
|
+
if (home && *home) {
|
|
623
|
+
char buf[1024];
|
|
624
|
+
snprintf(buf, sizeof(buf), "%s/.config/apex/plugins", home);
|
|
625
|
+
global_dir = strdup(buf);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (global_dir) {
|
|
629
|
+
load_plugins_from_dir(manager, global_dir);
|
|
630
|
+
free(global_dir);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
if (!manager->pre_parse && !manager->post_render) {
|
|
634
|
+
apex_plugins_free(manager);
|
|
635
|
+
return NULL;
|
|
636
|
+
}
|
|
637
|
+
return manager;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/* Apply declarative regex replacement: pattern compiled in p->regex,
|
|
641
|
+
* replacement template may reference $0..$9 for capture groups.
|
|
642
|
+
*/
|
|
643
|
+
static char *apply_regex_replacement(struct apex_plugin *p, const char *input) {
|
|
644
|
+
if (!p || !p->has_regex || !p->replacement || !input) return NULL;
|
|
645
|
+
|
|
646
|
+
size_t in_len = strlen(input);
|
|
647
|
+
size_t cap = in_len + 1;
|
|
648
|
+
char *out = malloc(cap);
|
|
649
|
+
if (!out) return NULL;
|
|
650
|
+
size_t out_len = 0;
|
|
651
|
+
|
|
652
|
+
const char *cursor = input;
|
|
653
|
+
regmatch_t matches[10];
|
|
654
|
+
int rc;
|
|
655
|
+
int any_match = 0;
|
|
656
|
+
|
|
657
|
+
while ((rc = regexec(&p->regex, cursor, 10, matches, 0)) == 0) {
|
|
658
|
+
if (matches[0].rm_so < 0) {
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
any_match = 1;
|
|
662
|
+
|
|
663
|
+
size_t pre_len = (size_t)matches[0].rm_so;
|
|
664
|
+
if (out_len + pre_len + 1 > cap) {
|
|
665
|
+
cap = (out_len + pre_len + 1) * 2;
|
|
666
|
+
char *nb = realloc(out, cap);
|
|
667
|
+
if (!nb) {
|
|
668
|
+
free(out);
|
|
669
|
+
return NULL;
|
|
670
|
+
}
|
|
671
|
+
out = nb;
|
|
672
|
+
}
|
|
673
|
+
memcpy(out + out_len, cursor, pre_len);
|
|
674
|
+
out_len += pre_len;
|
|
675
|
+
|
|
676
|
+
/* Build replacement text */
|
|
677
|
+
const char *tpl = p->replacement;
|
|
678
|
+
while (*tpl) {
|
|
679
|
+
if (*tpl == '$' && tpl[1] >= '0' && tpl[1] <= '9') {
|
|
680
|
+
int g = tpl[1] - '0';
|
|
681
|
+
tpl += 2;
|
|
682
|
+
if (g < 10 && matches[g].rm_so != -1 && matches[g].rm_eo >= matches[g].rm_so) {
|
|
683
|
+
size_t start = (size_t)matches[g].rm_so;
|
|
684
|
+
size_t end = (size_t)matches[g].rm_eo;
|
|
685
|
+
size_t glen = end - start;
|
|
686
|
+
if (out_len + glen + 1 > cap) {
|
|
687
|
+
cap = (out_len + glen + 1) * 2;
|
|
688
|
+
char *nb = realloc(out, cap);
|
|
689
|
+
if (!nb) {
|
|
690
|
+
free(out);
|
|
691
|
+
return NULL;
|
|
692
|
+
}
|
|
693
|
+
out = nb;
|
|
694
|
+
}
|
|
695
|
+
memcpy(out + out_len, cursor + start, glen);
|
|
696
|
+
out_len += glen;
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
if (out_len + 2 > cap) {
|
|
700
|
+
cap = (out_len + 2) * 2;
|
|
701
|
+
char *nb = realloc(out, cap);
|
|
702
|
+
if (!nb) {
|
|
703
|
+
free(out);
|
|
704
|
+
return NULL;
|
|
705
|
+
}
|
|
706
|
+
out = nb;
|
|
707
|
+
}
|
|
708
|
+
out[out_len++] = *tpl++;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
size_t adv = (size_t)matches[0].rm_eo;
|
|
713
|
+
if (adv == 0) {
|
|
714
|
+
/* Avoid infinite loop on zero-length matches */
|
|
715
|
+
if (*cursor) {
|
|
716
|
+
if (out_len + 2 > cap) {
|
|
717
|
+
cap = (out_len + 2) * 2;
|
|
718
|
+
char *nb = realloc(out, cap);
|
|
719
|
+
if (!nb) {
|
|
720
|
+
free(out);
|
|
721
|
+
return NULL;
|
|
722
|
+
}
|
|
723
|
+
out = nb;
|
|
724
|
+
}
|
|
725
|
+
out[out_len++] = *cursor;
|
|
726
|
+
cursor++;
|
|
727
|
+
} else {
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
cursor += adv;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (!any_match) {
|
|
736
|
+
free(out);
|
|
737
|
+
return NULL;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/* Copy remainder */
|
|
741
|
+
size_t tail_len = strlen(cursor);
|
|
742
|
+
if (out_len + tail_len + 1 > cap) {
|
|
743
|
+
cap = out_len + tail_len + 1;
|
|
744
|
+
char *nb = realloc(out, cap);
|
|
745
|
+
if (!nb) {
|
|
746
|
+
free(out);
|
|
747
|
+
return NULL;
|
|
748
|
+
}
|
|
749
|
+
out = nb;
|
|
750
|
+
}
|
|
751
|
+
memcpy(out + out_len, cursor, tail_len);
|
|
752
|
+
out_len += tail_len;
|
|
753
|
+
out[out_len] = '\0';
|
|
754
|
+
return out;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
char *apex_plugins_run_text_phase(apex_plugin_manager *manager,
|
|
758
|
+
apex_plugin_phase_mask phase,
|
|
759
|
+
const char *text,
|
|
760
|
+
const apex_options *options) {
|
|
761
|
+
if (!manager || !text || !options) return NULL;
|
|
762
|
+
|
|
763
|
+
int do_profile = apex_plugins_profiling_enabled();
|
|
764
|
+
double phase_start = 0.0;
|
|
765
|
+
if (do_profile) {
|
|
766
|
+
phase_start = apex_plugins_time_ms();
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
const char *phase_name = "unknown";
|
|
770
|
+
struct apex_plugin *plist = NULL;
|
|
771
|
+
if (phase == APEX_PLUGIN_PHASE_PRE_PARSE) {
|
|
772
|
+
plist = manager->pre_parse;
|
|
773
|
+
phase_name = "pre_parse";
|
|
774
|
+
} else if (phase == APEX_PLUGIN_PHASE_POST_RENDER) {
|
|
775
|
+
plist = manager->post_render;
|
|
776
|
+
phase_name = "post_render";
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
char *current = strdup(text);
|
|
780
|
+
if (!current) return NULL;
|
|
781
|
+
|
|
782
|
+
for (struct apex_plugin *p = plist; p; p = p->next) {
|
|
783
|
+
if (!(p->phases & phase)) continue;
|
|
784
|
+
|
|
785
|
+
char *next = NULL;
|
|
786
|
+
const char *plugin_id = p->id ? p->id : "plugin";
|
|
787
|
+
|
|
788
|
+
double plugin_start = 0.0;
|
|
789
|
+
if (do_profile) {
|
|
790
|
+
plugin_start = apex_plugins_time_ms();
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if (p->handler_command) {
|
|
794
|
+
/* Temporarily set APEX_PLUGIN_DIR, APEX_SUPPORT_DIR, and APEX_FILE_PATH for this plugin */
|
|
795
|
+
char *old_dir = NULL;
|
|
796
|
+
char *old_support = NULL;
|
|
797
|
+
char *old_file_path = NULL;
|
|
798
|
+
|
|
799
|
+
const char *prev_dir = getenv("APEX_PLUGIN_DIR");
|
|
800
|
+
if (prev_dir) {
|
|
801
|
+
old_dir = strdup(prev_dir);
|
|
802
|
+
}
|
|
803
|
+
if (p->dir_path) {
|
|
804
|
+
setenv("APEX_PLUGIN_DIR", p->dir_path, 1);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const char *prev_support = getenv("APEX_SUPPORT_DIR");
|
|
808
|
+
if (prev_support) {
|
|
809
|
+
old_support = strdup(prev_support);
|
|
810
|
+
}
|
|
811
|
+
if (p->support_dir) {
|
|
812
|
+
setenv("APEX_SUPPORT_DIR", p->support_dir, 1);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/* APEX_FILE_PATH: full path to input file, or base dir / empty for stdin */
|
|
816
|
+
const char *prev_file = getenv("APEX_FILE_PATH");
|
|
817
|
+
if (prev_file) {
|
|
818
|
+
old_file_path = strdup(prev_file);
|
|
819
|
+
}
|
|
820
|
+
const char *file_path = (options && options->input_file_path)
|
|
821
|
+
? options->input_file_path
|
|
822
|
+
: "";
|
|
823
|
+
setenv("APEX_FILE_PATH", file_path, 1);
|
|
824
|
+
|
|
825
|
+
next = apex_run_external_plugin_command(p->handler_command,
|
|
826
|
+
phase_name,
|
|
827
|
+
plugin_id,
|
|
828
|
+
current,
|
|
829
|
+
p->timeout_ms);
|
|
830
|
+
|
|
831
|
+
/* Restore previous APEX_PLUGIN_DIR */
|
|
832
|
+
if (p->dir_path) {
|
|
833
|
+
if (old_dir) {
|
|
834
|
+
setenv("APEX_PLUGIN_DIR", old_dir, 1);
|
|
835
|
+
free(old_dir);
|
|
836
|
+
} else {
|
|
837
|
+
unsetenv("APEX_PLUGIN_DIR");
|
|
838
|
+
}
|
|
839
|
+
} else if (old_dir) {
|
|
840
|
+
free(old_dir);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/* Restore previous APEX_SUPPORT_DIR */
|
|
844
|
+
if (p->support_dir) {
|
|
845
|
+
if (old_support) {
|
|
846
|
+
setenv("APEX_SUPPORT_DIR", old_support, 1);
|
|
847
|
+
free(old_support);
|
|
848
|
+
} else {
|
|
849
|
+
unsetenv("APEX_SUPPORT_DIR");
|
|
850
|
+
}
|
|
851
|
+
} else if (old_support) {
|
|
852
|
+
free(old_support);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/* Restore previous APEX_FILE_PATH */
|
|
856
|
+
if (old_file_path) {
|
|
857
|
+
setenv("APEX_FILE_PATH", old_file_path, 1);
|
|
858
|
+
free(old_file_path);
|
|
859
|
+
} else {
|
|
860
|
+
unsetenv("APEX_FILE_PATH");
|
|
861
|
+
}
|
|
862
|
+
} else if (p->has_regex) {
|
|
863
|
+
next = apply_regex_replacement(p, current);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
if (do_profile) {
|
|
867
|
+
double plugin_elapsed = apex_plugins_time_ms() - plugin_start;
|
|
868
|
+
fprintf(stderr,
|
|
869
|
+
"[PROFILE] plugin %-24s (%s): %8.2f ms\n",
|
|
870
|
+
plugin_id,
|
|
871
|
+
phase_name,
|
|
872
|
+
plugin_elapsed);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
if (next) {
|
|
876
|
+
free(current);
|
|
877
|
+
current = next;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
if (do_profile) {
|
|
882
|
+
double phase_elapsed = apex_plugins_time_ms() - phase_start;
|
|
883
|
+
fprintf(stderr,
|
|
884
|
+
"[PROFILE] plugins_phase (%s): %8.2f ms\n",
|
|
885
|
+
phase_name,
|
|
886
|
+
phase_elapsed);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (strcmp(current, text) == 0) {
|
|
890
|
+
free(current);
|
|
891
|
+
return NULL;
|
|
892
|
+
}
|
|
893
|
+
return current;
|
|
894
|
+
}
|
|
895
|
+
|