From 2c3991ac05293acbe6157d23ceab778bcd1cd687 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 09:34:23 +1000 Subject: [PATCH 1/8] chore(c-cpp): union files.associations from ~/dev vscode settings Give the 28 in-wave C/C++ projects (and gold **c** / **cxx** / **c_cxx** templates) a sorted **files.associations** union of all associations found under **~/dev**; --- .editorconfig | 50 +++++++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b409470 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,50 @@ +root = true + +# Language indent/EOL/charset overlap with .vscode/settings.json. +# Rulers, renderWhitespace, detectIndentation, mergeEditor, and +# language-server settings cannot be expressed here — they stay in +# settings.json. + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# [bat] +[*.{bat,cmd}] +end_of_line = crlf +indent_size = 4 +indent_style = space + +# [c] +[*.{c,h}] +indent_size = 4 +indent_style = space + +# [cmake] +[{CMakeLists.txt,*.cmake}] +indent_size = 4 +indent_style = tab + +# [json] +[*.json] +indent_size = 2 +indent_style = space + +# [markdown] +[*.md] +indent_size = 2 +indent_style = space + +# [shellscript] +[*.{bash,sh,zsh}] +indent_size = 2 +indent_style = space + +# [yaml] +[*.{yaml,yml}] +indent_size = 2 +indent_style = space diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fe51d2..6a0da10 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,8 @@ "editor.tabSize": 4, }, "[c]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -14,6 +16,8 @@ "editor.tabSize": 4, }, "[cpp]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -49,13 +53,28 @@ "editor.insertSpaces": true, "editor.tabSize": 2, }, + "C_Cpp.autocompleteAddParentheses": true, + "C_Cpp.clang_format_fallbackStyle": "none", + "C_Cpp.clang_format_style": "file", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++17", + "C_Cpp.enhancedColorization": "enabled", + "C_Cpp.errorSquiggles": "enabled", + "C_Cpp.formatting": "clangFormat", + "C_Cpp.intelliSenseEngine": "default", "cmake.configureOnOpen": false, + "debug.allowBreakpointsEverywhere": true, "editor.detectIndentation": false, "editor.insertSpaces": false, "editor.renderWhitespace": "all", "editor.rulers": [ 76 ], "editor.tabSize": 2, "files.associations": { + "*.gemspec": "ruby", + "*.mdoc": "troff", + "*.roff": "troff", + "Gemfile": "ruby", + "Rakefile": "ruby", "__bit_reference": "cpp", "__bits": "cpp", "__config": "cpp", @@ -76,13 +95,17 @@ "__tuple": "cpp", "__verbose_abort": "cpp", "algorithm": "cpp", + "api.h": "c", "array": "cpp", "atomic": "cpp", + "auto_buffer.h": "c", "bit": "cpp", "bitset": "cpp", "cctype": "cpp", "charconv": "cpp", "chrono": "cpp", + "clasp.h": "c", + "cli_helpers.h": "c", "clocale": "cpp", "cmath": "cpp", "compare": "cpp", @@ -109,6 +132,7 @@ "functional": "cpp", "implicit_link.h": "c", "initializer_list": "cpp", + "invoke.h": "c", "io.h": "c", "iomanip": "cpp", "ios": "cpp", @@ -119,28 +143,39 @@ "limits": "cpp", "list": "cpp", "locale": "cpp", + "main.h": "c", "map": "cpp", "memory": "cpp", "memory_resource": "cpp", "mutex": "cpp", + "net_helpers.h": "c", "new": "cpp", "numbers": "cpp", "numeric": "cpp", "optional": "cpp", "ostream": "cpp", + "path_functions.h": "c", + "print": "cpp", "queue": "cpp", "random": "cpp", "ranges": "cpp", "ratio": "cpp", + "rc.h": "c", + "recls.h": "c", + "result_codes_.h": "c", "semaphore": "cpp", "set": "cpp", "setenv.h": "c", "shwild.h": "c", + "sleep_functions.h": "c", "span": "cpp", "sstream": "cpp", "stack": "cpp", + "stdatomic.h": "c", + "stdbool.h": "c", "stdexcept": "cpp", "stdio.h": "c", + "stock.h": "c", "stop_token": "cpp", "streambuf": "cpp", "string": "cpp", @@ -149,6 +184,7 @@ "terse-api.h": "c", "text_encoding": "cpp", "thread": "cpp", + "trace.h": "c", "tuple": "cpp", "type_traits": "cpp", "typeinfo": "cpp", @@ -159,6 +195,7 @@ "utility": "cpp", "variant": "cpp", "vector": "cpp", + "williamscrc.h": "c", "xfacet": "cpp", "xhash": "cpp", "xiosbase": "cpp", From 32a6d662312bcf47d7e8195f7aa995790c051c77 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:13:30 +1000 Subject: [PATCH 2/8] .gitattributes --- .gitattributes | 116 ++++++++++++++++++++++++++----- .gitignore | 182 +++++++++++++++++++++---------------------------- 2 files changed, 176 insertions(+), 122 deletions(-) diff --git a/.gitattributes b/.gitattributes index e6605d1..76a2f86 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,99 @@ -*.c linguist-language=C -*.cmake linguist-language=CMake -*.cmd linguist-detectable=false -*.cpp linguist-language=C++ -*.cxx linguist-language=C++ -*.dsp linguist-detectable=false -*.dsw linguist-detectable=false -*.h linguist-language=C -*.hpp linguist-language=C++ -*.html linguist-detectable=false -*.hxx linguist-language=C++ -*.sh linguist-detectable=false -*.sln linguist-detectable=false -*.vcxproj linguist-detectable=false -*.vimrc linguist-detectable=false -CMakeLists.txt linguist-language=CMake -makefile linguist-detectable=false +# .gitattributes — C / C++ (GitHub-hosted) +# +# Sources: GitHub Docs (line endings), git-scm gitattributes (diff=cpp), +# gitattributes/gitattributes C++.gitattributes + Common.gitattributes, +# github-linguist overrides. + +# Default: detect text, normalize to LF in the repository +* text=auto + +# --- Source --- +*.c text diff=cpp +*.c++ text diff=cpp +*.cc text diff=cpp +*.cpp text diff=cpp +*.cxx text diff=cpp +*.h text diff=cpp +*.h++ text diff=cpp +*.hh text diff=cpp +*.hpp text diff=cpp +*.hxx text diff=cpp +*.inc text +*.inl text +*.ipp text +*.tcc text +*.tpp text + +# --- Build / config --- +*.am text +*.cmake text +*.m4 text +*.mak text +*.mk text +*akefile text +CMakeLists.txt text +configure text eol=lf +configure.ac text + +# --- Scripts --- +*.bash text eol=lf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf +*.sh text eol=lf +*.zsh text eol=lf + +# --- Docs / meta --- +*.adoc text +*.markdown text diff=markdown +*.md text diff=markdown +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +LICENSE text +NEWS text +README text +TODO text +.gitattributes text +.gitignore text + +# --- Serialisation --- +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# --- Compiled / binary artefacts --- +*.a binary +*.dll binary +*.dylib binary +*.exe binary +*.gch binary +*.la binary +*.lai binary +*.lib binary +*.lo binary +*.o binary +*.obj binary +*.out binary +*.pch binary +*.slo binary +*.so binary + +# --- Archives / images (common) --- +*.gif binary +*.gz binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.tar binary +*.zip binary + +# --- GitHub Linguist --- +**/build/** linguist-generated +**/cmake-build-*/** linguist-generated diff --git a/.gitignore b/.gitignore index 68e4424..226c160 100644 --- a/.gitignore +++ b/.gitignore @@ -1,164 +1,127 @@ -# Synesis Information Systems .gitignore for C/C++ libraries +# Synesis Information Systems .gitignore for C / C++ libraries # directories (by name) -/.git-old/ -/.vs/ +bin/ +ideas/ +ipch/ +lib/ +scripts/internal/ +Win32/ +x64/ +.idea/ .svn/ +.vs/ -.classpath -/.idea/ -/__pycache__ -/node_modules +__pycache__/ -/_build/ +/_analyses/ /_build-ci/ +/_build/ /_internal/ -/_analyses/ - -/bin/ -/ipch/ -/lib/ -bin/ -ipch/ -lib/ -/doc/ /docs/ /dox/ -/dox /ideas/ -ideas/ +/include/xcontract/ +/include/xcover/ /included/ +/node_modules/ /releases/ /scratch/ -/temp/ - -/--include -/--src -/-include -/-src - -/examples/bin -/examples/c/bin -/examples/cpp/bin - -/examples/lib -/examples/c/lib -/examples/cpp/lib - -projects/util/vc10-generated/ - -perf_test/ - -scripts/internal/ - -/include/shwild/ -/include/xcontract/ -/include/xcover/ -/include/xtests/ -/src/shwild/ /src/xcontract/ /src/xcover/ -/src/xtests/ +/target/ +/temp/ + +/examples/bin/ +/examples/c/bin/ +/examples/c/lib/ +/examples/cpp/bin/ +/examples/cpp/lib/ +/examples/lib/ -Debug Multithreaded DLL/ Debug Multithreaded Dll/ -Debug Multithreaded pseudoUNIX/ +Debug Multithreaded DLL/ Debug Multithreaded pseudoUnix/ +Debug Multithreaded pseudoUNIX/ Debug Multithreaded/ Debug/ +DebugDll/ DebugDLL/ DebugDLLUNIX/ -DebugDll/ -DebugMTDLL/ +DebugMt/ DebugMTDll/ +DebugMTDLL/ DebugMTUnix/ -DebugMt/ DebugNox/ -DebugUNIX/ DebugUnix/ -Release Multithreaded DLL/ +DebugUNIX/ Release Multithreaded Dll/ -Release Multithreaded pseudoUNIX/ +Release Multithreaded DLL/ Release Multithreaded pseudoUnix/ +Release Multithreaded pseudoUNIX/ Release Multithreaded/ Release/ +ReleaseDll/ ReleaseDLL/ ReleaseDLLUNIX/ -ReleaseDll/ -ReleaseMTDLL/ +ReleaseMt/ ReleaseMTDll/ +ReleaseMTDLL/ ReleaseMTUnix/ -ReleaseMt/ ReleaseNox/ ReleaseUnix/ UDebug/ UDebugMt/ -URelease/ -UReleaseMt/ -Unicode Debug Multithreaded DLL/ Unicode Debug Multithreaded Dll/ +Unicode Debug Multithreaded DLL/ Unicode Debug Multithreaded/ Unicode Debug/ -Unicode Release Multithreaded DLL/ Unicode Release Multithreaded Dll/ +Unicode Release Multithreaded DLL/ Unicode Release Multithreaded/ Unicode Release/ - -Win32/ -x64/ +URelease/ +UReleaseMt/ # directories (by pattern) -/build/ar* -/build/bc5* -/build/como* -/build/cw* -/build/gcc3* -/build/gcc4* -/build/icl* -/build/vc5* -/build/*.zip - /include-*/ # files (by name) .DS_Store + +.classpath +.env.development.local +.env.local +.env.production.local +.env.test.local .ruby-version -.ruby-version-exclusions .svnignore .svnignore-at-root .update_deps -.env.local -.env.development.local -.env.test.local -.env.production.local - -list_changes.cmd -logging-bailout.txt -prepare.cmd -sh.exe.stackdump -tidydir.cmd -update_deps.cmd +build/CMakeCache.txt build/makefile.tmpl build/makefile.tools.xml build/shwild.tmplgen -build/CMakeCache.txt - -include/fastformat/internal/dos2unix.has.been.performed include/pantheios/internal/dos2unix.has.been.performed include/stlsoft/dos2unix.has.been.performed include/stlsoft/internal/dos2unix.has.been.performed - +list_changes.cmd +logging-bailout.txt +prepare.cmd +sh.exe.stackdump test/testpatterns.orj test/tests-plan.txt +tidydir.cmd +update_deps.cmd # files (by pattern) @@ -166,8 +129,6 @@ test/tests-plan.txt *~ *.*~ *.???_obj -*.VC.db -*.VC.opendb *.a *.app *.aps @@ -175,6 +136,7 @@ test/tests-plan.txt *.bak *.chm *.class +*.csproj*user *.d *.diff *.dll @@ -211,32 +173,42 @@ test/tests-plan.txt *.slo *.so *.suo -*.swp *.sw[ponm] +*.swp *.test *.tlog *.tmp *.unsuccessfulbuild -*.vcproj*.user -*.vcxproj*.user -*.csproj*user -*.vcproj*user -*.vcxproj*user +*.VC.db +*.VC.opendb *.xcuserstate *.zip -*.vc71.sln -*.vc8.sln -*.vc9.sln +/build/*.tmpl +/build/*.tmplgen +/build/*.tools.xml +/build/*.zip +/build/ar* +/build/bc5* +/build/como* +/build/cw* +/build/gcc3* +/build/gcc4* +/build/icl* +/build/vc5* RCa0* RCb0* -build/*.tmplgen -build/*.tmpl -build/*.tools.xml - npm-debug.log* yarn-debug.log* yarn-error.log* +*.vc71.sln +*.vc8.sln +*.vc9.sln +*.vcproj*.user +*.vcproj*user +*.vcxproj*.user +*.vcxproj*user + From d6b5faded4670b8f332f30439d234f65f312c6b9 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:17:30 +1000 Subject: [PATCH 3/8] .vscode/settings.json --- .vscode/settings.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6a0da10..6aa78f6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "editor.defaultFormatter": "ms-vscode.cpptools", "editor.formatOnSave": true, "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76 ], + "editor.rulers": [ 60, 64, 68, 72, 76, 120 ], "editor.tabSize": 4, }, "[cmake]": { @@ -19,7 +19,7 @@ "editor.defaultFormatter": "ms-vscode.cpptools", "editor.formatOnSave": true, "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76 ], + "editor.rulers": [ 60, 64, 68, 72, 76, 120 ], "editor.tabSize": 4, }, "[json]": { @@ -38,6 +38,7 @@ }, "[ruby]": { "editor.insertSpaces": true, + "editor.rulers": [ 60, 76 ], "editor.tabSize": 2, }, "[shellscript]": { From 26350b325a98eae5af157dde5d73e88d55e26bf9 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:18:51 +1000 Subject: [PATCH 4/8] .vimrc --- .vimrc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.vimrc b/.vimrc index 1bf33a0..cebe6af 100644 --- a/.vimrc +++ b/.vimrc @@ -42,29 +42,29 @@ autocmd BufWritePre * %s/\s\+$//e augroup sis_c_cxx autocmd! + " [bat] + autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 " [c] / [cpp] autocmd FileType c,cpp setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,64,68,72,76 - " [rust] - autocmd FileType rs setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=76 - " [cmake] autocmd FileType cmake setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 - " [shellscript] - autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 - - " [bat] - autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 - - " [json] / [markdown] / [yaml] / [ruby] - autocmd FileType json,markdown,yaml,ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 + " [json] / [markdown] / [ruby] / [yaml] + autocmd FileType json,markdown,ruby,yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 " [python] autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 + " [rust] + autocmd FileType rs setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=76 + + " [shellscript] + autocmd FileType bash,sh,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 + " [toml] autocmd FileType toml setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 + augroup END From 9011ca64853073d3d6b71b096236cd46ed4a105f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:21:58 +1000 Subject: [PATCH 5/8] CHANGES.md --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 77dd7dd..d1c0d63 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ # cmpfs - Changes +## Unreleased + +* Applied **misc-dev-scripts** **0.6.0** editor/Git/`.sis` drop-in templates on **boilerplate**; +* Restored historical **.gitignore** patterns as a sorted union with **misc-dev-scripts** gold section layout; + + ## 0.0.1-alpha1 - 21st August 2026 * Created a Synesis-style **C** library skeleton: version macros, **CMake** packaging, **.sis** helper-script identity, modular GitHub Actions CI (**ci.yml** / **ci-cell.yml**), and install-smoke as a C consumer; From 5e6a135e618a406c340c49035d9c6dd2e91107be Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 11:14:08 +1000 Subject: [PATCH 6/8] chore(): use computed PREFIX_VER with documented PATCH Align library version macros to c-cpp-standards. Define MAJOR, MINOR, PATCH, and ALPHABETA; compute PREFIX_VER by shifts; keep REVISION as a skip-section alias of PATCH (target at column 60); retain named historical VER_* constants only for comparison and documentation. --- include/cmpfs/cmpfs.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/cmpfs/cmpfs.h b/include/cmpfs/cmpfs.h index 27c1dd5..605093f 100644 --- a/include/cmpfs/cmpfs.h +++ b/include/cmpfs/cmpfs.h @@ -4,7 +4,7 @@ * Purpose: Main C header for the cmpfs library. * * Created: ... 2010 ... - * Updated: 21st August 2026 + * Updated: 17th September 2026 * * Home: https://github.com/synesissoftware/cmpfs * @@ -55,8 +55,8 @@ #ifndef CMPFS_DOCUMENTATION_SKIP_SECTION # define CMPFS_VER_CMPFS_H_CMPFS_MAJOR 1 # define CMPFS_VER_CMPFS_H_CMPFS_MINOR 1 -# define CMPFS_VER_CMPFS_H_CMPFS_REVISION 1 -# define CMPFS_VER_CMPFS_H_CMPFS_EDIT 12 +# define CMPFS_VER_CMPFS_H_CMPFS_REVISION 2 +# define CMPFS_VER_CMPFS_H_CMPFS_EDIT 13 #endif /* !CMPFS_DOCUMENTATION_SKIP_SECTION */ /** \def CMPFS_VER_MAJOR @@ -71,8 +71,9 @@ * The patch version number of cmpfs */ -/** \def CMPFS_VER_AB - * The alpha/beta designator of cmpfs, or 0xFF for a non-prerelease +/** \def CMPFS_VER_ALPHABETA + * The alpha/beta number of cmpfs, in the range 1-0xFE for prerelease + * versions, and 0xFF for a released version */ /** \def CMPFS_VER @@ -82,18 +83,19 @@ #define CMPFS_VER_MAJOR 1 #define CMPFS_VER_MINOR 1 #define CMPFS_VER_PATCH 0 -#define CMPFS_VER_AB 0x41 +#define CMPFS_VER_ALPHABETA 0x41 #define CMPFS_VER \ (0\ | ( CMPFS_VER_MAJOR << 24 ) \ | ( CMPFS_VER_MINOR << 16 ) \ | ( CMPFS_VER_PATCH << 8 ) \ - | ( CMPFS_VER_AB << 0 ) \ + | ( CMPFS_VER_ALPHABETA << 0 ) \ ) #ifndef CMPFS_DOCUMENTATION_SKIP_SECTION -# define CMPFS_VER_REVISION CMPFS_VER_PATCH +# define CMPFS_VER_REVISION CMPFS_VER_PATCH +# define CMPFS_VER_AB CMPFS_VER_ALPHABETA #endif /* !CMPFS_DOCUMENTATION_SKIP_SECTION */ From 01a2247ccca5f8bf2875e4a441e75d2415707e91 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 17:11:53 +1000 Subject: [PATCH 7/8] squash-merge --- .github/workflows/ci.yml | 2 +- INSTALL.md | 2 +- examples/c/example.c.1/example.c.1.c | 10 ++++++++-- include/cmpfs/cmpfs.h | 19 ++++++++++++------- src/compare.api.c | 3 ++- .../test.unit.compare.api.c | 6 +++--- .../test.unit.version/test.unit.version.c | 8 ++++---- 7 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e5063..c3255ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,7 +178,7 @@ jobs: #endif int main(void) { - return (ENOSYS == cmpfs_compare_binary_files("a", "b", 0)) ? 0 : 1; + return (ENOSYS == cmpfs_compare_binary_files("a", "b", 0, NULL)) ? 0 : 1; } EOF if [ "${{ matrix.c_compiler }}" = "cl" ]; then diff --git a/INSTALL.md b/INSTALL.md index f88f129..49d5ad0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -91,7 +91,7 @@ The primary choice for installation is by use of **CMake**. int main(void) { - int const r = cmpfs_compare_binary_files("a.bin", "b.bin", NULL); + int const r = cmpfs_compare_binary_files("a.bin", "b.bin", 0, NULL); printf("status %d (ENOSYS=%d while skeleton)\n", r, ENOSYS); diff --git a/examples/c/example.c.1/example.c.1.c b/examples/c/example.c.1/example.c.1.c index 3f0811b..94090bd 100644 --- a/examples/c/example.c.1/example.c.1.c +++ b/examples/c/example.c.1/example.c.1.c @@ -5,11 +5,17 @@ * compare-API status. * * Created: 21st August 2026 - * Updated: 21st August 2026 + * Updated: 17th September 2026 * * ////////////////////////////////////////////////////////////////////// */ +#if defined(_MSC_VER) && \ + !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS +#endif /* _MSC_VER && !_CRT_SECURE_NO_WARNINGS */ + + #include #include @@ -36,7 +42,7 @@ main(void) , CMPFS_VER ); - r = cmpfs_compare_binary_files("left.bin", "right.bin", &result); + r = cmpfs_compare_binary_files("left.bin", "right.bin", CMPFS_F_NONE, &result); if (ENOSYS == r) { diff --git a/include/cmpfs/cmpfs.h b/include/cmpfs/cmpfs.h index 605093f..d0b764d 100644 --- a/include/cmpfs/cmpfs.h +++ b/include/cmpfs/cmpfs.h @@ -72,18 +72,17 @@ */ /** \def CMPFS_VER_ALPHABETA - * The alpha/beta number of cmpfs, in the range 1-0xFE for prerelease - * versions, and 0xFF for a released version + * The alpha/beta designator of cmpfs, or 0xFF for a non-prerelease */ /** \def CMPFS_VER * The current composite version number of cmpfs */ -#define CMPFS_VER_MAJOR 1 -#define CMPFS_VER_MINOR 1 -#define CMPFS_VER_PATCH 0 -#define CMPFS_VER_ALPHABETA 0x41 +#define CMPFS_VER_MAJOR 0 +#define CMPFS_VER_MINOR 0 +#define CMPFS_VER_PATCH 1 +#define CMPFS_VER_ALPHABETA 0x42 #define CMPFS_VER \ (0\ @@ -93,9 +92,15 @@ | ( CMPFS_VER_ALPHABETA << 0 ) \ ) +/** \def CMPFS_VER_0_0_1_ALPHA_1 + * Composite version number for 0.0.1-alpha1 + */ +#define CMPFS_VER_0_0_1_ALPHA_1 0x00000141 +#define CMPFS_VER_0_0_1_ALPHA_2 0x00000142 + #ifndef CMPFS_DOCUMENTATION_SKIP_SECTION # define CMPFS_VER_REVISION CMPFS_VER_PATCH -# define CMPFS_VER_AB CMPFS_VER_ALPHABETA +# define CMPFS_VER_AB CMPFS_VER_ALPHABETA #endif /* !CMPFS_DOCUMENTATION_SKIP_SECTION */ diff --git a/src/compare.api.c b/src/compare.api.c index 27f6aa5..f386835 100644 --- a/src/compare.api.c +++ b/src/compare.api.c @@ -4,7 +4,7 @@ * Purpose: Skeleton implementation of the cmpfs comparison API. * * Created: ... 2010 ... - * Updated: 21st August 2026 + * Updated: 17th September 2026 * * Home: https://github.com/synesissoftware/cmpfs * @@ -71,6 +71,7 @@ cmpfs_compare_binary_files( ((void)path1); ((void)path2); + ((void)flags); if (NULL != result) { diff --git a/test/unit/test.unit.compare.api/test.unit.compare.api.c b/test/unit/test.unit.compare.api/test.unit.compare.api.c index c7c0654..ae6e2c1 100644 --- a/test/unit/test.unit.compare.api/test.unit.compare.api.c +++ b/test/unit/test.unit.compare.api/test.unit.compare.api.c @@ -4,7 +4,7 @@ * Purpose: Unit tests for the cmpfs skeleton comparison API. * * Created: 21st August 2026 - * Updated: 21st August 2026 + * Updated: 17th September 2026 * * ////////////////////////////////////////////////////////////////////// */ @@ -25,7 +25,7 @@ static void test_compare_binary_files_is_stub(void) { cmpfs_comparison_result_t result; - int const r = cmpfs_compare_binary_files("a", "b", &result); + int const r = cmpfs_compare_binary_files("a", "b", CMPFS_F_NONE, &result); XTESTS_TEST_INTEGER_EQUAL(ENOSYS, r); XTESTS_TEST_INTEGER_EQUAL(0, result.equal); @@ -36,7 +36,7 @@ test_compare_binary_files_is_stub(void) static void test_compare_binary_files_accepts_null_result(void) { - int const r = cmpfs_compare_binary_files("a", "b", NULL); + int const r = cmpfs_compare_binary_files("a", "b", CMPFS_F_NONE, NULL); XTESTS_TEST_INTEGER_EQUAL(ENOSYS, r); } diff --git a/test/unit/test.unit.version/test.unit.version.c b/test/unit/test.unit.version/test.unit.version.c index b13e8b0..0c5f2da 100644 --- a/test/unit/test.unit.version/test.unit.version.c +++ b/test/unit/test.unit.version/test.unit.version.c @@ -4,7 +4,7 @@ * Purpose: Unit tests for cmpfs version macros. * * Created: 21st August 2026 - * Updated: 21st August 2026 + * Updated: 17th September 2026 * * ////////////////////////////////////////////////////////////////////// */ @@ -22,7 +22,7 @@ test_version_components(void) XTESTS_TEST_INTEGER_EQUAL(0, CMPFS_VER_MAJOR); XTESTS_TEST_INTEGER_EQUAL(0, CMPFS_VER_MINOR); XTESTS_TEST_INTEGER_EQUAL(1, CMPFS_VER_PATCH); - XTESTS_TEST_INTEGER_EQUAL(0x41, CMPFS_VER_ALPHABETA); + XTESTS_TEST_INTEGER_EQUAL(0x42, CMPFS_VER_ALPHABETA); XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_PATCH, CMPFS_VER_REVISION); } @@ -38,8 +38,8 @@ test_version_composite(void) ); XTESTS_TEST_INTEGER_EQUAL(computed, CMPFS_VER); - XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_0_0_1_ALPHA_1, CMPFS_VER); - XTESTS_TEST_INTEGER_EQUAL(0x00000141, CMPFS_VER); + XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_0_0_1_ALPHA_2, CMPFS_VER); + XTESTS_TEST_INTEGER_EQUAL(0x00000142, CMPFS_VER); } From 8710f1a2d06f453e50e1bc15d63f865f776ac61f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 21 Sep 2026 12:17:32 +1000 Subject: [PATCH 8/8] squash-commit --- CHANGES.md | 10 +--- NEWS.md | 6 +- include/cmpfs/cmpfs.h | 2 +- test/scratch/CMakeLists.txt | 1 + test/scratch/versions/CMakeLists.txt | 1 + test/scratch/versions/main.c | 60 +++++++++++++++++++ .../test.unit.version/test.unit.version.c | 6 +- 7 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 test/scratch/versions/CMakeLists.txt create mode 100644 test/scratch/versions/main.c diff --git a/CHANGES.md b/CHANGES.md index d1c0d63..cb66909 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,17 +1,13 @@ # cmpfs - Changes -## Unreleased - -* Applied **misc-dev-scripts** **0.6.0** editor/Git/`.sis` drop-in templates on **boilerplate**; -* Restored historical **.gitignore** patterns as a sorted union with **misc-dev-scripts** gold section layout; - - -## 0.0.1-alpha1 - 21st August 2026 +## 0.0.1-alpha1 - 21st September 2026 * Created a Synesis-style **C** library skeleton: version macros, **CMake** packaging, **.sis** helper-script identity, modular GitHub Actions CI (**ci.yml** / **ci-cell.yml**), and install-smoke as a C consumer; * Declared stub **`cmpfs_compare_binary_files()`** and **`cmpfs_compare_text_files()`** (currently **`ENOSYS`**); * Added C example **example.c.1** and **xTests** unit coverage for version macros and the stub compare API; +* Applied **misc-dev-scripts** **0.6.0** editor/Git/`.sis` drop-in templates on **boilerplate**; +* Restored historical **.gitignore** patterns as a sorted union with **misc-dev-scripts** gold section layout; diff --git a/NEWS.md b/NEWS.md index 22fc3c7..10c9826 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,9 +8,9 @@ ## News -| Date | News Item | -| ---------------- | -------------------------------------------------------------------------------- | -| 21st August 2026 | cmpfs 0.0.1-alpha1 | +| Date | News Item | Details | +| ---------------- | ------------------- | ------- | +| 21st August 2026 | cmpfs 0.0.1-alpha1 | initial public release | diff --git a/include/cmpfs/cmpfs.h b/include/cmpfs/cmpfs.h index 9615929..6087438 100644 --- a/include/cmpfs/cmpfs.h +++ b/include/cmpfs/cmpfs.h @@ -4,7 +4,7 @@ * Purpose: Main C header for the cmpfs library. * * Created: ... 2010 ... - * Updated: 17th September 2026 + * Updated: 21st September 2026 * * Home: https://github.com/synesissoftware/cmpfs * diff --git a/test/scratch/CMakeLists.txt b/test/scratch/CMakeLists.txt index 17608a6..afeea9d 100644 --- a/test/scratch/CMakeLists.txt +++ b/test/scratch/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(test.scratch.compare) +add_subdirectory(versions) # ############################## end of file ############################# # diff --git a/test/scratch/versions/CMakeLists.txt b/test/scratch/versions/CMakeLists.txt new file mode 100644 index 0000000..8db359b --- /dev/null +++ b/test/scratch/versions/CMakeLists.txt @@ -0,0 +1 @@ +define_example_program(versions main.c) diff --git a/test/scratch/versions/main.c b/test/scratch/versions/main.c new file mode 100644 index 0000000..c4bab42 --- /dev/null +++ b/test/scratch/versions/main.c @@ -0,0 +1,60 @@ +/* ///////////////////////////////////////////////////////////////////////// + * File: test/scratch/versions/main.c + * + * Purpose: Prints cmpfs composite version. + * + * Created: 17th September 2026 + * Updated: 17th September 2026 + * + * ////////////////////////////////////////////////////////////////////// */ + + +#include + +#include +#include + + +#define PROGRAM_NAME "versions" + + +static void +version( + FILE* stm +, char const* prefix +, char const* libname +, char const* macroname +, unsigned libver +) +{ + fprintf( + stm + , "%s%s: v%u.%u.%u.%u (%s = 0x%08x)\n" + , prefix + , libname + , (libver >> 24) & 0xff + , (libver >> 16) & 0xff + , (libver >> 8) & 0xff + , (libver >> 0) & 0xff + , macroname + , libver + ); +} + + +int main(int argc, char* argv[]) +{ + ((void)&argc); + ((void)&argv); + + { + unsigned const libver = (unsigned)CMPFS_VER; + + version(stdout, "", "cmpfs", "CMPFS_VER", libver); + } + + return EXIT_SUCCESS; +} + + +/* ///////////////////////////// end of file //////////////////////////// */ diff --git a/test/unit/test.unit.version/test.unit.version.c b/test/unit/test.unit.version/test.unit.version.c index 0c5f2da..8856005 100644 --- a/test/unit/test.unit.version/test.unit.version.c +++ b/test/unit/test.unit.version/test.unit.version.c @@ -22,7 +22,7 @@ test_version_components(void) XTESTS_TEST_INTEGER_EQUAL(0, CMPFS_VER_MAJOR); XTESTS_TEST_INTEGER_EQUAL(0, CMPFS_VER_MINOR); XTESTS_TEST_INTEGER_EQUAL(1, CMPFS_VER_PATCH); - XTESTS_TEST_INTEGER_EQUAL(0x42, CMPFS_VER_ALPHABETA); + XTESTS_TEST_INTEGER_EQUAL(0x41, CMPFS_VER_ALPHABETA); XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_PATCH, CMPFS_VER_REVISION); } @@ -38,8 +38,8 @@ test_version_composite(void) ); XTESTS_TEST_INTEGER_EQUAL(computed, CMPFS_VER); - XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_0_0_1_ALPHA_2, CMPFS_VER); - XTESTS_TEST_INTEGER_EQUAL(0x00000142, CMPFS_VER); + XTESTS_TEST_INTEGER_EQUAL(CMPFS_VER_0_0_1_ALPHA_1, CMPFS_VER); + XTESTS_TEST_INTEGER_EQUAL(0x00000141, CMPFS_VER); }