Skip to content

Commit a96c789

Browse files
chore(cstring): adopt helper gold 0.6.2 and target 4.1.0-beta1
- Copy misc-dev-scripts 0.6.2 runners and merge prepare_cmake.sh, keeping the cstring -D flags and --gap-groups on the performance runners; - Define CSTRING_VER_RELSTATUS as 0x81 (4.1.0-beta1) and alias CSTRING_VER_ALPHABETA to it;
1 parent 810307c commit a96c789

10 files changed

Lines changed: 404 additions & 33 deletions

‎CHANGES.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# cstring - Changes <!-- omit in toc -->
22

33

4+
## 4.1.0-beta1 - 21st October 2026
5+
6+
* Brought the tip CMake runners up to **misc-dev-scripts** 0.6.2 and merged that gold into **prepare_cmake.sh**, keeping the cstring `-D` flags and `--gap-groups`;
7+
* Defined `CSTRING_VER_RELSTATUS` (`0x81`, beta 1) and aliased `CSTRING_VER_ALPHABETA` to it;
8+
9+
410
## 4.1.0-alpha1 - 6th October 2026
511

612
* Added 64-bit `djb2` hash functions: `cstring_hash_djb2()`, `cstring_hash_djb2_case()`, `cstring_hash_djb2_buf()`, and `cstring_hash_djb2_buf_case()`;

‎Doxyfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PROJECT_NAME = "cstring"
44
PROJECT_BRIEF = "Extensible C-style strings and vectors of such, for Unix and Windows"
5-
PROJECT_NUMBER = 4.1.0-alpha1
5+
PROJECT_NUMBER = 4.1.0-beta1
66

77
# Prefer SIS_CMAKE_BUILD_DIR-aligned output (same convention as Diagnosticism).
88
# ./dox/ remains gitignored for legacy/local runs that override OUTPUT_DIRECTORY.

‎NEWS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Date | News Item | Details |
55
| ------------------- | ------------------------------------ | ------- |
66
| Available from [**cstring** project on GitHub](https://synesissoftware.com/cstring): |
7+
| 21st October 2026 | Release of [cstring 4.1.0-beta1](https://github.com/synesissoftware/cstring/releases/tag/4.1.0-beta1) | helper gold 0.6.2; `CSTRING_VER_RELSTATUS` |
78
| 6th October 2026 | Release of [cstring 4.1.0-alpha1](https://github.com/synesissoftware/cstring/releases/tag/4.1.0-alpha1) | `djb2`, `FNV-1a`, and `SDBM`; `cstring_equal()` / `cstring_compare()`; `--wide-strings`; counted copies stop at `cch` |
89
| 4th October 2026 | Release of [cstring 4.0.19](https://github.com/synesissoftware/cstring/releases/tag/4.0.19) | lone CR ends a line; `numRead` includes EOL; readonly truncate; zero-size realloc frees; **test.performance.cstring_readline**; shortened test and example directories; **test.unit.cstring**; README usage modes |
910
| 29th September 2026 | Release of [cstring 4.0.18](https://github.com/synesissoftware/cstring/releases/tag/4.0.18) | `_WIN32` arena gate; **win.c**; static `CoTaskMem*` (**ole32**) |

‎include/cstring/cstring.h‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Purpose: Definition of the cstring.core API.
55
*
66
* Created: 16th June 1994
7-
* Updated: 6th October 2026
7+
* Updated: 21st October 2026
88
*
99
* Home: http://synesis.com.au/software/
1010
*
@@ -56,7 +56,7 @@
5656
# define CSTRING_VER_CSTRING_H_CSTRING_MAJOR 3
5757
# define CSTRING_VER_CSTRING_H_CSTRING_MINOR 13
5858
# define CSTRING_VER_CSTRING_H_CSTRING_REVISION 3
59-
# define CSTRING_VER_CSTRING_H_CSTRING_EDIT 100
59+
# define CSTRING_VER_CSTRING_H_CSTRING_EDIT 103
6060
#endif /* !CSTRING_DOCUMENTATION_SKIP_SECTION */
6161

6262

@@ -105,6 +105,8 @@
105105
# define CSTRING_VER_4_0_18 0x040012ff
106106
# define CSTRING_VER_4_0_19 0x040013ff
107107
# define CSTRING_VER_4_1_0_A1 0x04010041
108+
# define CSTRING_VER_4_1_0_A2 0x04010042
109+
# define CSTRING_VER_4_1_0_B1 0x04010081
108110
#endif /* !CSTRING_DOCUMENTATION_SKIP_SECTION */
109111

110112
/** \def CSTRING_VER_MAJOR
@@ -119,24 +121,29 @@
119121
* The patch version number of **cstring**
120122
*/
121123

124+
/** \def CSTRING_VER_RELSTATUS
125+
* The release-status number of **cstring**
126+
*/
127+
122128
/** \def CSTRING_VER
123129
* The current composite version number of **cstring**
124130
*/
125131

126132
#define CSTRING_VER_MAJOR 4
127133
#define CSTRING_VER_MINOR 1
128134
#define CSTRING_VER_PATCH 0
129-
#define CSTRING_VER_ALPHABETA 0x41
135+
#define CSTRING_VER_RELSTATUS 0x81
130136

131137
#define CSTRING_VER \
132138
(0\
133139
| ( CSTRING_VER_MAJOR << 24 ) \
134140
| ( CSTRING_VER_MINOR << 16 ) \
135141
| ( CSTRING_VER_PATCH << 8 ) \
136-
| ( CSTRING_VER_ALPHABETA << 0 ) \
142+
| ( CSTRING_VER_RELSTATUS << 0 ) \
137143
)
138144

139145
#ifndef CSTRING_DOCUMENTATION_SKIP_SECTION
146+
# define CSTRING_VER_ALPHABETA CSTRING_VER_RELSTATUS
140147
# define CSTRING_VER_REVISION CSTRING_VER_PATCH
141148
#endif /* !CSTRING_DOCUMENTATION_SKIP_SECTION */
142149

‎prepare_cmake.sh‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,24 @@ Configuration=Release
3434
ExamplesDisabled=0
3535
MinGW=$(sis_cmake_is_truey "${SIS_CMAKE_MINGW:-}" && echo 1 || echo 0)
3636
MSVC_MT=0
37-
NO_cxx=0
38-
NO_p99=0
39-
NO_shwild=0
4037
RunMake=0
4138
SisUseColours=0
42-
STLSoftDirGiven=
4339
TestingDisabled=0
4440
VerboseMakefile=0
45-
WideStrings=0
4641

42+
# ##########################################################
43+
# PROJECT-SPECIFIC FLAGS (customise per library; keep marker)
44+
#
45+
# Add project-only options here (e.g. --no-cpp, --stlsoft-root-dir,
46+
# --no-shwild). The common body below must stay aligned with
47+
# misc-dev-scripts/shell-scripts/cmake-helpers/prepare_cmake.sh.
48+
49+
50+
NO_cxx=0
51+
NO_p99=0
52+
NO_shwild=0
53+
STLSoftDirGiven=
54+
WideStrings=0
4755

4856
# ##########################################################
4957
# colours

‎run_all_examples.cmd‎

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ SETLOCAL
44

55
SET SCRIPT_DIRECTORY=%~dp0
66
SET SCRIPT_PATH_DOC=%~n0[%~x0]
7+
SET "ALLOWED_TO_FAIL_FILE=%SCRIPT_DIRECTORY%.sis\ci_examples_allowed_to_fail.txt"
8+
SET "PROGRAM_STATUS=0"
79

810
IF DEFINED SIS_CMAKE_BUILD_DIR (
911

@@ -45,6 +47,22 @@ Flags/options: ^
4547

4648
displays this help and terminates ^
4749

50+
^
51+
52+
files: ^
53+
54+
^
55+
56+
.sis\ci_examples_allowed_to_fail.txt ^
57+
58+
optional list of example programs ^(one name per line; ^
59+
60+
lines beginning with '#' are ignored^) that are allowed to fail; ^
61+
62+
such a program is still executed, but a non-zero exit is ^
63+
64+
reported as anticipated and does not stop the run ^
65+
4866

4967
EXIT /B 0
5068
) ELSE (
@@ -78,12 +96,36 @@ SET SIS_EXAMPLE_SMOKE=1
7896

7997
ECHO Running all %ProjectName% example programs
8098

81-
FOR /F "usebackq" %%f IN (`DIR /A:-D /B /S "%CMAKE_DIR%" ^| FINDSTR /I example.*\.exe$`) DO (
82-
83-
ECHO .
84-
ECHO executing %%f
85-
%%f
86-
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
87-
)
88-
89-
ENDLOCAL
99+
FOR /F "usebackq" %%f IN (`DIR /A:-D /B /S "%CMAKE_DIR%" ^| FINDSTR /I example.*\.exe$`) DO CALL :run_program "%%f"
100+
101+
ENDLOCAL & EXIT /B %PROGRAM_STATUS%
102+
103+
104+
REM ##########################################################
105+
REM subroutines
106+
107+
:run_program
108+
IF %PROGRAM_STATUS% NEQ 0 EXIT /B 0
109+
ECHO .
110+
ECHO executing %~1
111+
"%~1"
112+
SET "FAILURE_STATUS=%ERRORLEVEL%"
113+
IF %FAILURE_STATUS% EQU 0 EXIT /B 0
114+
CALL :is_allowed_to_fail "%~1"
115+
IF NOT DEFINED ALLOWED_TO_FAIL GOTO run_program_failed
116+
ECHO anticipated failure: %~1 exited with status %FAILURE_STATUS%; it is listed in .sis\ci_examples_allowed_to_fail.txt
117+
EXIT /B 0
118+
:run_program_failed
119+
SET "PROGRAM_STATUS=%FAILURE_STATUS%"
120+
EXIT /B 0
121+
122+
:is_allowed_to_fail
123+
SET "ALLOWED_TO_FAIL="
124+
IF NOT EXIST "%ALLOWED_TO_FAIL_FILE%" EXIT /B 0
125+
FOR /F "usebackq eol=# tokens=1" %%n IN ("%ALLOWED_TO_FAIL_FILE%") DO CALL :match_allowed "%%n" "%~n1" "%~nx1"
126+
EXIT /B 0
127+
128+
:match_allowed
129+
IF /I "%~1"=="%~2" SET "ALLOWED_TO_FAIL=1"
130+
IF /I "%~1"=="%~3" SET "ALLOWED_TO_FAIL=1"
131+
EXIT /B 0

‎run_all_examples.sh‎

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build}
2727
ProjectNameFile="$Dir/.sis/project_name.txt"
2828
ProjectName=$(tr -d '[:space:]' < "$ProjectNameFile")
2929
ScriptPath=$0
30+
AllowedToFailFile="$Dir/.sis/ci_examples_allowed_to_fail.txt"
3031

3132
AlwaysUseColours=${SIS_CMAKE_ALWAYS_USE_COLOURS:-${SIS_ALWAYS_USE_COLOURS:-0}}
3233
ListOnly=0
@@ -115,6 +116,49 @@ sis_cmake_build() {
115116
cmake "${args[@]}"
116117
}
117118

119+
# Reduces a program path to its (lowercase) name, without any directory or
120+
# .exe suffix.
121+
sis_program_stem() {
122+
123+
local p="${1//\\//}"
124+
125+
p="${p##*/}"
126+
127+
case "$p" in
128+
*.exe|*.EXE) p="${p%.*}" ;;
129+
esac
130+
131+
printf '%s' "$p" | tr '[:upper:]' '[:lower:]'
132+
}
133+
134+
# Succeeds if the program is named (by name or stem, case-insensitively) in
135+
# the optional .sis/ci_examples_allowed_to_fail.txt file; blank lines and
136+
# lines beginning with '#' are ignored.
137+
sis_is_allowed_to_fail() {
138+
139+
local name line
140+
141+
[ -f "$AllowedToFailFile" ] || return 1
142+
143+
name=$(sis_program_stem "$1")
144+
145+
while IFS= read -r line || [ -n "$line" ]; do
146+
147+
line="${line//$'\r'/}"
148+
149+
case "$line" in
150+
''|\#*) continue ;;
151+
esac
152+
153+
if [ "$name" = "$(sis_program_stem "$line")" ]; then
154+
155+
return 0
156+
fi
157+
done < "$AllowedToFailFile"
158+
159+
return 1
160+
}
161+
118162

119163
# ##########################################################
120164
# command-line handling
@@ -160,6 +204,15 @@ Flags/options:
160204
does not execute a build before running programs
161205
162206
207+
files:
208+
209+
.sis/ci_examples_allowed_to_fail.txt
210+
optional list of example programs (one name per line; blank lines
211+
and lines beginning with '#' are ignored) that are allowed to fail;
212+
such a program is still executed, but a non-zero exit is reported as
213+
anticipated and neither stops the run nor affects the exit status
214+
215+
163216
standard flags:
164217
165218
--help
@@ -247,7 +300,13 @@ if [ $status -eq 0 ]; then
247300

248301
if [ $ListOnly -ne 0 ]; then
249302

250-
echo "would execute ${fClr}:"
303+
if sis_is_allowed_to_fail "$f"; then
304+
305+
echo "would execute ${fClr} (allowed to fail):"
306+
else
307+
308+
echo "would execute ${fClr}:"
309+
fi
251310

252311
continue
253312
fi
@@ -260,11 +319,25 @@ if [ $status -eq 0 ]; then
260319
:
261320
else
262321

263-
status=$?
322+
fStatus=$?
323+
324+
if sis_is_allowed_to_fail "$f"; then
325+
326+
echo "${SisClr_Yellow}${SisClr_Bold}anticipated failure${SisClr_None}: ${fClr} exited with status ${fStatus}; it is listed in .sis/ci_examples_allowed_to_fail.txt"
327+
328+
continue
329+
fi
330+
331+
status=$fStatus
264332

265333
break 1
266334
fi
267-
done < <(find "$CMakeDir" -type f \( -name 'example*' ! -name '*.md' \) \( -perm -100 -o -name '*.exe' \) -print0 2>/dev/null | sort -z)
335+
done < <(find "$CMakeDir" -type f \( -name 'example*' ! -name '*.md' \) \
336+
! -path '*/CMakeFiles/*' \
337+
! -name '*.a' \
338+
! -name '*.d' \
339+
! -name '*.lib' \
340+
\( -perm -100 -o -name '*.exe' \) -print0 2>/dev/null | sort -z)
268341

269342
if [ $NumPrograms -eq 0 ]; then
270343

0 commit comments

Comments
 (0)