diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 892fcce6..490a357d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -8,7 +8,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
- compiler: [g++,clang++]
+ # clang++ has been disabled for Jan 2026 update
+ #compiler: [g++,clang++]
+ compiler: [g++]
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
@@ -37,16 +39,16 @@ jobs:
matrix:
os: [ubuntu-22.04]
test:
- - compiler: clang++
- job: normalize
- - compiler: clang++
- job: comp
+ #- compiler: clang++
+ # job: normalize
+ #- compiler: clang++
+ # job: comp
- compiler: g++
job: normalize
- compiler: g++
job: comp
- compiler: g++
- job: cov
+ job: coverage
- compiler: g++
job: memcheck
steps:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1c7757db..f00bd2cf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,9 +9,9 @@ cache:
- temp/cppcheck.Linux.g++
stages:
+ - master-only
- build
- test
- - master-only
- sched-only
# skip pipeline for master, and for temporary branches not eligible to be merged
@@ -21,6 +21,12 @@ stages:
- /^tmp.*/
- schedules
+# skip pipeline schedules
+.excludes_schedules: &excludes_schedules_tmp
+ except:
+ - schedules
+ - /^tmp.*/
+
# execute pipeline on when master changes
.masteronly: &masteronly
rules:
@@ -35,18 +41,20 @@ stages:
when: always
before_script:
- - 'echo "${CI_JOB_STAGE}:${CI_JOB_NAME} host:$(hostname) pwd:$(pwd) user:$(whoami) date:$(date)"'
- - export PATH=$PATH:bin
+ - echo "${CI_JOB_STAGE}:${CI_JOB_NAME} host:$(hostname) pwd:$(pwd) user:$(whoami) date:$(date)"
+ - export PATH="$PATH:bin"
build:
stage: build
script:
- bin/ai
+ - gcache -install -dir .gcache
artifacts:
paths:
- build
+ - .gcache
expire_in: 1 week
- <<: *excludes
+ <<: *excludes_schedules_tmp
normalize:
stage: test
@@ -64,51 +72,41 @@ comp:
script:
- bin/normalize "${CI_JOB_NAME}"
artifacts:
- reports:
- coverage_report:
- coverage_format: cobertura
- path: temp/atf_comp/cov.d/cobertura.xml
- when: on_failure
+ when: always
paths:
- temp/*.log
expire_in: 1 week
+ # run on feature branches (no master no schedule)
<<: *excludes
-memcheck:
+
+coverage:
stage: test
script:
- bin/normalize "${CI_JOB_NAME}"
- <<: *excludes
-
-# Master only actions
-
-deploy-html-docs:
-# build pages for gitlab deployment
- stage: master-only
- script:
- - bin/gitlab_master_ci deploy-html-docs
- <<: *masteronly
+ # added coverage report parsing
+ coverage: '/TOTAL\s+\d+\s+\d+\s+([\d.]+)%?/' # Extracts 58.62 from "TOTAL 22124 12970 58.62"
+ artifacts:
+ when: always
+ reports:
+ coverage_report:
+ coverage_format: cobertura
+ path: temp/atf_comp/cov.d/cobertura.xml
+ # run on all CI runs(feature branches for MR code coverage widget and master branch for analytics)
+ <<: *excludes_schedules_tmp
-backup-master-to-github:
-# push master to github
- stage: master-only
- script:
- - bin/gitlab_master_ci backup-master-to-github
- <<: *masteronly
-backup-issues-to-github:
-# read all open issue and create files based on them
-# create commit and push it as issue branch
- stage: master-only
+memcheck:
+ stage: test
script:
- - bin/gitlab_master_ci backup-issues-to-github
- <<: *masteronly
+ - bin/normalize "${CI_JOB_NAME}"
+ <<: *excludes
# Schedule only actions
future-scheduled-actions:
# Do some task
- stage: sched-only
+ stage: sched-only
script:
- echo HELLO SCHED
<<: *schedonly
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 00000000..e411c19c
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,18 @@
+{
+ "configurations": [
+ {
+ "name": "Linux",
+ "includePath": [
+ "${workspaceFolder}/**",
+ "/usr/include",
+ "/usr/local/include"
+ ],
+ "defines": [],
+ "compilerPath": "/usr/bin/gcc",
+ "intelliSenseMode": "linux-gcc-x64",
+ "cStandard": "c11",
+ "cppStandard": "c++17"
+ }
+ ],
+ "version": 4
+}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..95047e42
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,30 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "ACR Launch",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${workspaceFolder}/temp/a.out",
+ "args": [],
+ "stopAtEntry": false,
+ "cwd": "${workspaceFolder}",
+ "environment": [],
+ "externalConsole": false,
+ "MIMode": "gdb",
+ "setupCommands": [
+ {
+ "description": "Enable pretty-printing for gdb",
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ },
+ {
+ "description": "Set Disassembly Flavor to Intel",
+ "text": "-gdb-set disassembly-flavor intel",
+ "ignoreFailures": true
+ }
+ ],
+ "preLaunchTask": "ACR select debug target"
+ },
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..bef395f5
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,30 @@
+{
+ "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 120, IndentCaseLabels:false, IndentCaseBlocks:true, InsertBraces:true}",
+ "editor.wordWrapColumn": 120,
+ "editor.autoClosingBrackets": "never",
+ "[cpp]": {
+ "editor.defaultFormatter": "ms-vscode.cpptools"
+ },
+ "files.trimTrailingWhitespace": true,
+ "files.associations": {
+ "typeinfo": "cpp",
+ "memory": "cpp",
+ "tuple": "cpp",
+ "array": "cpp",
+ "string_view": "cpp",
+ "initializer_list": "cpp",
+ "new": "cpp",
+ "system_error": "cpp",
+ "compare": "cpp",
+ "functional": "cpp",
+ "ratio": "cpp",
+ "type_traits": "cpp",
+ "utility": "cpp",
+ "condition_variable": "cpp",
+ "cstddef": "cpp"
+ },
+ "search.exclude": {
+ "temp": true,
+ "build": true,
+ },
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 00000000..47e536a1
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,67 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "ACR release build",
+ "type": "shell",
+ "command": "ai && acr -check % && amc && update-hdr && abt %",
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ }
+ },
+ {
+ "label": "ACR debug build",
+ "type": "shell",
+ "command": "abt -cfg:debug %",
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": {
+ "kind": "build",
+ "isDefault": false
+ },
+ "dependsOn": [
+ "ACR release build"
+ ]
+ },
+ {
+ "label": "ACR normalize",
+ "type": "shell",
+ "command": "normalize",
+ "group": {
+ "kind": "test",
+ "isDefault": false
+ },
+ "dependsOn": [
+ "ACR release build"
+ ]
+ },
+ {
+ "label": "ACR select debug target",
+ "type": "shell",
+ "command": "bin/vscode-select-debug-target ${file} ${workspaceFolder}/temp/a.out",
+ "group": {
+ "kind": "build",
+ "isDefault": false
+ },
+ "dependsOn": [
+ "ACR debug build"
+ ]
+ },
+ {
+ "label": "Indent current source and update headers",
+ "type": "shell",
+ "command": "bin/cpp-indent ${file}; update-hdr",
+ "group": {
+ "kind": "build",
+ "isDefault": false
+ },
+ },
+ ]
+}
diff --git a/bin/abt_md_filt b/bin/abt_md_filt
index 40f301b8..f04cfdb2 100755
--- a/bin/abt_md_filt
+++ b/bin/abt_md_filt
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/ai b/bin/ai
index bd18f6e2..296b01c6 100755
--- a/bin/ai
+++ b/bin/ai
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ sub Die {
print "error $_[0]. more info in txt/exe/abt/README.md\n";
exit(1);
}
-my $clean = scalar(grep(/^-clean$/,@ARGV)) || (system("abt --version >/dev/null 2>/dev/null")!=0 && ! -x "bin/abt");
+my $clean = scalar(grep(/^-clean$/,@ARGV)) || system("abt --version >/dev/null 2>/dev/null")!=0;
@ARGV = grep(!/^-clean$/,@ARGV);
# check if abt exists
if ($clean) {
@@ -37,4 +37,4 @@ $F = "%" if !$F;
# allow this one to fail
system("bin/src_hdr", "-write", "-targsrc:%");
# main build step
-system("bin/abt", "-build", $F, @ARGV)==0 or Die("abt failed: $?");
+system("bin/abt", "-build", "-install", $F, @ARGV)==0 or Die("abt failed: $?");
diff --git a/bin/alexei-setup-soft-links b/bin/alexei-setup-soft-links
index 998c45bc..39766433 100755
--- a/bin/alexei-setup-soft-links
+++ b/bin/alexei-setup-soft-links
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/ams_cat b/bin/ams_cat
deleted file mode 120000
index a877ebd7..00000000
--- a/bin/ams_cat
+++ /dev/null
@@ -1 +0,0 @@
-../build/release/ams_cat
\ No newline at end of file
diff --git a/bin/atf_exp b/bin/atf_exp
new file mode 120000
index 00000000..aa225266
--- /dev/null
+++ b/bin/atf_exp
@@ -0,0 +1 @@
+../build/release/atf_exp
\ No newline at end of file
diff --git a/bin/bash-indent b/bin/bash-indent
new file mode 100755
index 00000000..fb973357
--- /dev/null
+++ b/bin/bash-indent
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# License: GPL
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+command -v shfmt >/dev/null || sudo bin/install-shfmt >/dev/null 2>&1
+for f in "${@:-/dev/stdin}"; do shfmt -w "$f"; done
diff --git a/bin/bootstrap/Darwin-clang++.release-x86_64 b/bin/bootstrap/Darwin-clang++.release-x86_64
index 0f5dbe9c..4a1d8752 100755
--- a/bin/bootstrap/Darwin-clang++.release-x86_64
+++ b/bin/bootstrap/Darwin-clang++.release-x86_64
@@ -30,84 +30,94 @@ mkdir -p build/Darwin-clang++.release-x86_64 # create target directory
ln -s Darwin-clang++.release-x86_64 build/release # and a soft link to it
set -e
set -x
-mkdir -p temp
+mkdir -p temp temp/abt
mkdir -p build/release || true
mkdir -p build/release || true
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_decode.cpp -o build/release/cpp.lib.algo.bin_decode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_encode.cpp -o build/release/cpp.lib.algo.bin_encode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/replscope.cpp -o build/release/cpp.lib.algo.replscope.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/url.cpp -o build/release/cpp.lib.algo.url.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/uuid.cpp -o build/release/cpp.lib.algo.uuid.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_json_gen.cpp -o build/release/cpp.gen.lib_json_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_json.cpp -o build/release/cpp.lib.lib_json.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
+rm -f build/release/lib_json-x86_64.a.tmp
+llvm-ar cr build/release/lib_json-x86_64.a.tmp build/release/cpp.gen.lib_json_gen.o build/release/cpp.lib.lib_json.o && llvm-ranlib build/release/lib_json-x86_64.a.tmp
+mv -f build/release/lib_json-x86_64.a.tmp build/release/lib_json-x86_64.a
rm -f build/release/algo_lib-x86_64.a.tmp
-llvm-ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-x86_64.a.tmp
+llvm-ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.bin_decode.o build/release/cpp.lib.algo.bin_encode.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.replscope.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.url.o build/release/cpp.lib.algo.uuid.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-x86_64.a.tmp
mv -f build/release/algo_lib-x86_64.a.tmp build/release/algo_lib-x86_64.a
rm -f build/release/abt.tmp
-clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/abt.tmp build/release/abt
ln -sf ../build/release/abt bin/abt
rm -f build/release/gcache.tmp
-clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -lcrypto build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -lcrypto -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/gcache.tmp build/release/gcache
ln -sf ../build/release/gcache bin/gcache
rm -f build/release/src_func.tmp
-clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_func.tmp build/release/src_func
ln -sf ../build/release/src_func bin/src_func
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class
rm -f build/release/lib_git-x86_64.a.tmp
llvm-ar cr build/release/lib_git-x86_64.a.tmp build/release/cpp.gen.lib_git_gen.o build/release/cpp.lib.lib_git.o && llvm-ranlib build/release/lib_git-x86_64.a.tmp
mv -f build/release/lib_git-x86_64.a.tmp build/release/lib_git-x86_64.a
rm -f build/release/src_hdr.tmp
-clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -L /usr/local/lib build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_hdr.tmp build/release/src_hdr
ln -sf ../build/release/src_hdr bin/src_hdr
diff --git a/bin/bootstrap/FreeBSD-clang++.release-amd64 b/bin/bootstrap/FreeBSD-clang++.release-amd64
index 425d1ebd..44529bc7 100755
--- a/bin/bootstrap/FreeBSD-clang++.release-amd64
+++ b/bin/bootstrap/FreeBSD-clang++.release-amd64
@@ -30,84 +30,94 @@ mkdir -p build/FreeBSD-clang++.release-amd64 # create target directory
ln -s FreeBSD-clang++.release-amd64 build/release # and a soft link to it
set -e
set -x
-mkdir -p temp
+mkdir -p temp temp/abt
mkdir -p build/release || true
mkdir -p build/release || true
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_decode.cpp -o build/release/cpp.lib.algo.bin_decode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_encode.cpp -o build/release/cpp.lib.algo.bin_encode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/replscope.cpp -o build/release/cpp.lib.algo.replscope.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/url.cpp -o build/release/cpp.lib.algo.url.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/uuid.cpp -o build/release/cpp.lib.algo.uuid.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_json_gen.cpp -o build/release/cpp.gen.lib_json_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_json.cpp -o build/release/cpp.lib.lib_json.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
+rm -f build/release/lib_json-amd64.a.tmp
+llvm-ar cr build/release/lib_json-amd64.a.tmp build/release/cpp.gen.lib_json_gen.o build/release/cpp.lib.lib_json.o && llvm-ranlib build/release/lib_json-amd64.a.tmp
+mv -f build/release/lib_json-amd64.a.tmp build/release/lib_json-amd64.a
rm -f build/release/algo_lib-amd64.a.tmp
-llvm-ar cr build/release/algo_lib-amd64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-amd64.a.tmp
+llvm-ar cr build/release/algo_lib-amd64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.bin_decode.o build/release/cpp.lib.algo.bin_encode.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.replscope.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.url.o build/release/cpp.lib.algo.uuid.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-amd64.a.tmp
mv -f build/release/algo_lib-amd64.a.tmp build/release/algo_lib-amd64.a
rm -f build/release/abt.tmp
-clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a -lexecinfo build/release/algo_lib-amd64.a
+clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp build/release/algo_lib-amd64.a build/release/lib_json-amd64.a build/release/lib_json-amd64.a build/release/algo_lib-amd64.a -lexecinfo build/release/algo_lib-amd64.a
mv -f build/release/abt.tmp build/release/abt
ln -sf ../build/release/abt bin/abt
rm -f build/release/gcache.tmp
-clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a -lcrypto -lexecinfo build/release/algo_lib-amd64.a
+clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp build/release/algo_lib-amd64.a build/release/lib_json-amd64.a build/release/lib_json-amd64.a build/release/algo_lib-amd64.a -lcrypto -lexecinfo build/release/algo_lib-amd64.a
mv -f build/release/gcache.tmp build/release/gcache
ln -sf ../build/release/gcache bin/gcache
rm -f build/release/src_func.tmp
-clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a -lexecinfo build/release/algo_lib-amd64.a
+clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp build/release/algo_lib-amd64.a build/release/lib_json-amd64.a build/release/lib_json-amd64.a build/release/algo_lib-amd64.a -lexecinfo build/release/algo_lib-amd64.a
mv -f build/release/src_func.tmp build/release/src_func
ln -sf ../build/release/src_func bin/src_func
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -I /usr/local/include
rm -f build/release/lib_git-amd64.a.tmp
llvm-ar cr build/release/lib_git-amd64.a.tmp build/release/cpp.gen.lib_git_gen.o build/release/cpp.lib.lib_git.o && llvm-ranlib build/release/lib_git-amd64.a.tmp
mv -f build/release/lib_git-amd64.a.tmp build/release/lib_git-amd64.a
rm -f build/release/src_hdr.tmp
-clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a build/release/lib_git-amd64.a build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a build/release/lib_git-amd64.a -lexecinfo build/release/algo_lib-amd64.a
+clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp build/release/algo_lib-amd64.a build/release/lib_json-amd64.a build/release/lib_json-amd64.a build/release/algo_lib-amd64.a build/release/lib_git-amd64.a build/release/algo_lib-amd64.a build/release/algo_lib-amd64.a build/release/lib_git-amd64.a -lexecinfo build/release/algo_lib-amd64.a
mv -f build/release/src_hdr.tmp build/release/src_hdr
ln -sf ../build/release/src_hdr bin/src_hdr
diff --git a/bin/bootstrap/Linux-clang++.release-x86_64 b/bin/bootstrap/Linux-clang++.release-x86_64
index c55631d1..e1c87983 100755
--- a/bin/bootstrap/Linux-clang++.release-x86_64
+++ b/bin/bootstrap/Linux-clang++.release-x86_64
@@ -30,84 +30,94 @@ mkdir -p build/Linux-clang++.release-x86_64 # create target directory
ln -s Linux-clang++.release-x86_64 build/release # and a soft link to it
set -e
set -x
-mkdir -p temp
+mkdir -p temp temp/abt
mkdir -p build/release || true
mkdir -p build/release || true
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_decode.cpp -o build/release/cpp.lib.algo.bin_decode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/bin_encode.cpp -o build/release/cpp.lib.algo.bin_encode.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/replscope.cpp -o build/release/cpp.lib.algo.replscope.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/url.cpp -o build/release/cpp.lib.algo.url.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/uuid.cpp -o build/release/cpp.lib.algo.uuid.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/gen/lib_json_gen.cpp -o build/release/cpp.gen.lib_json_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+clang++ -x c++ -Wno-invalid-offsetof -ffunction-sections -Wsequence-point -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -fpch-preprocess -c cpp/lib/lib_json.cpp -o build/release/cpp.lib.lib_json.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
+rm -f build/release/lib_json-x86_64.a.tmp
+llvm-ar cr build/release/lib_json-x86_64.a.tmp build/release/cpp.gen.lib_json_gen.o build/release/cpp.lib.lib_json.o && llvm-ranlib build/release/lib_json-x86_64.a.tmp
+mv -f build/release/lib_json-x86_64.a.tmp build/release/lib_json-x86_64.a
rm -f build/release/algo_lib-x86_64.a.tmp
-llvm-ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-x86_64.a.tmp
+llvm-ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.bin_decode.o build/release/cpp.lib.algo.bin_encode.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.replscope.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.url.o build/release/cpp.lib.algo.uuid.o build/release/cpp.lib.algo.win32.o && llvm-ranlib build/release/algo_lib-x86_64.a.tmp
mv -f build/release/algo_lib-x86_64.a.tmp build/release/algo_lib-x86_64.a
rm -f build/release/abt.tmp
-clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/abt.tmp build/release/abt
ln -sf ../build/release/abt bin/abt
rm -f build/release/gcache.tmp
-clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -lcrypto -ldl -lm build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -lcrypto -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/gcache.tmp build/release/gcache
ln -sf ../build/release/gcache bin/gcache
rm -f build/release/src_func.tmp
-clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_func.tmp build/release/src_func
ln -sf ../build/release/src_func bin/src_func
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
-clang++ -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -ffunction-sections -Wsequence-point -std=c++11 -Wno-multichar -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Wno-enum-compare -Wno-array-bounds -Wno-missing-exception-spec -iquote . -Wno-vla -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O -Werror -Wreinterpret-base-class -Wno-long-long
rm -f build/release/lib_git-x86_64.a.tmp
llvm-ar cr build/release/lib_git-x86_64.a.tmp build/release/cpp.gen.lib_git_gen.o build/release/cpp.lib.lib_git.o && llvm-ranlib build/release/lib_git-x86_64.a.tmp
mv -f build/release/lib_git-x86_64.a.tmp build/release/lib_git-x86_64.a
rm -f build/release/src_hdr.tmp
-clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+clang++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -pthread -Wl,--gc-sections build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_hdr.tmp build/release/src_hdr
ln -sf ../build/release/src_hdr bin/src_hdr
diff --git a/bin/bootstrap/Linux-g++.release-x86_64 b/bin/bootstrap/Linux-g++.release-x86_64
index f6c554db..f1c7b6d1 100755
--- a/bin/bootstrap/Linux-g++.release-x86_64
+++ b/bin/bootstrap/Linux-g++.release-x86_64
@@ -30,84 +30,94 @@ mkdir -p build/Linux-g++.release-x86_64 # create target directory
ln -s Linux-g++.release-x86_64 build/release # and a soft link to it
set -e
set -x
-mkdir -p temp
+mkdir -p temp temp/abt
mkdir -p build/release || true
mkdir -p build/release || true
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type -Wno-stringop-overflow
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/build.cpp -o build/release/cpp.abt.build.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/disas.cpp -o build/release/cpp.abt.disas.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/main.cpp -o build/release/cpp.abt.main.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/ood.cpp -o build/release/cpp.abt.ood.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/opt.cpp -o build/release/cpp.abt.opt.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/abt/scan.cpp -o build/release/cpp.abt.scan.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/abt_gen.cpp -o build/release/cpp.gen.abt_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gcache/gcache.cpp -o build/release/cpp.gcache.gcache.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/gcache_gen.cpp -o build/release/cpp.gen.gcache_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/src_func_gen.cpp -o build/release/cpp.gen.src_func_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/edit.cpp -o build/release/cpp.src_func.edit.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/fileloc.cpp -o build/release/cpp.src_func.fileloc.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/header.cpp -o build/release/cpp.src_func.header.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/iffy.cpp -o build/release/cpp.src_func.iffy.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/list.cpp -o build/release/cpp.src_func.list.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/main.cpp -o build/release/cpp.src_func.main.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/nextfile.cpp -o build/release/cpp.src_func.nextfile.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_func/scan.cpp -o build/release/cpp.src_func.scan.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/src_hdr_gen.cpp -o build/release/cpp.gen.src_hdr_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/src_hdr/hdr.cpp -o build/release/cpp.src_hdr.hdr.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/_gen.cpp -o build/release/cpp.gen._gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/algo_gen.cpp -o build/release/cpp.gen.algo_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/algo_lib_gen.cpp -o build/release/cpp.gen.algo_lib_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/command_gen.cpp -o build/release/cpp.gen.command_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/dev_gen.cpp -o build/release/cpp.gen.dev_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/dmmeta_gen.cpp -o build/release/cpp.gen.dmmeta_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/report_gen.cpp -o build/release/cpp.gen.report_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/arg.cpp -o build/release/cpp.lib.algo.arg.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/backtrace.cpp -o build/release/cpp.lib.algo.backtrace.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/base64.cpp -o build/release/cpp.lib.algo.base64.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/bin_decode.cpp -o build/release/cpp.lib.algo.bin_decode.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/bin_encode.cpp -o build/release/cpp.lib.algo.bin_encode.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/cpu_hz.cpp -o build/release/cpp.lib.algo.cpu_hz.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/crc32.cpp -o build/release/cpp.lib.algo.crc32.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/decimal.cpp -o build/release/cpp.lib.algo.decimal.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/errtext.cpp -o build/release/cpp.lib.algo.errtext.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/file.cpp -o build/release/cpp.lib.algo.file.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/fmt.cpp -o build/release/cpp.lib.algo.fmt.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/iohook.cpp -o build/release/cpp.lib.algo.iohook.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/lib.cpp -o build/release/cpp.lib.algo.lib.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/line.cpp -o build/release/cpp.lib.algo.line.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/lockfile.cpp -o build/release/cpp.lib.algo.lockfile.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/mmap.cpp -o build/release/cpp.lib.algo.mmap.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/prlog.cpp -o build/release/cpp.lib.algo.prlog.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/regx.cpp -o build/release/cpp.lib.algo.regx.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/replscope.cpp -o build/release/cpp.lib.algo.replscope.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/string.cpp -o build/release/cpp.lib.algo.string.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/time.cpp -o build/release/cpp.lib.algo.time.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/timehook.cpp -o build/release/cpp.lib.algo.timehook.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/tstamp.cpp -o build/release/cpp.lib.algo.tstamp.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/txttbl.cpp -o build/release/cpp.lib.algo.txttbl.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/u128.cpp -o build/release/cpp.lib.algo.u128.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/url.cpp -o build/release/cpp.lib.algo.url.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/uuid.cpp -o build/release/cpp.lib.algo.uuid.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/algo/win32.cpp -o build/release/cpp.lib.algo.win32.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/lib_json_gen.cpp -o build/release/cpp.gen.lib_json_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+g++ -x c++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wno-missing-field-initializers -Wno-stringop-overflow -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/lib_json.cpp -o build/release/cpp.lib.lib_json.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
+rm -f build/release/lib_json-x86_64.a.tmp
+ar cr build/release/lib_json-x86_64.a.tmp build/release/cpp.gen.lib_json_gen.o build/release/cpp.lib.lib_json.o && ranlib build/release/lib_json-x86_64.a.tmp
+mv -f build/release/lib_json-x86_64.a.tmp build/release/lib_json-x86_64.a
rm -f build/release/algo_lib-x86_64.a.tmp
-ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.win32.o && ranlib build/release/algo_lib-x86_64.a.tmp
+ar cr build/release/algo_lib-x86_64.a.tmp build/release/cpp.gen._gen.o build/release/cpp.gen.algo_gen.o build/release/cpp.gen.algo_lib_gen.o build/release/cpp.gen.command_gen.o build/release/cpp.gen.dev_gen.o build/release/cpp.gen.dmmeta_gen.o build/release/cpp.gen.report_gen.o build/release/cpp.lib.algo.arg.o build/release/cpp.lib.algo.backtrace.o build/release/cpp.lib.algo.base64.o build/release/cpp.lib.algo.bin_decode.o build/release/cpp.lib.algo.bin_encode.o build/release/cpp.lib.algo.cpu_hz.o build/release/cpp.lib.algo.crc32.o build/release/cpp.lib.algo.decimal.o build/release/cpp.lib.algo.errtext.o build/release/cpp.lib.algo.file.o build/release/cpp.lib.algo.fmt.o build/release/cpp.lib.algo.iohook.o build/release/cpp.lib.algo.lib.o build/release/cpp.lib.algo.line.o build/release/cpp.lib.algo.lockfile.o build/release/cpp.lib.algo.mmap.o build/release/cpp.lib.algo.prlog.o build/release/cpp.lib.algo.regx.o build/release/cpp.lib.algo.replscope.o build/release/cpp.lib.algo.string.o build/release/cpp.lib.algo.time.o build/release/cpp.lib.algo.timehook.o build/release/cpp.lib.algo.tstamp.o build/release/cpp.lib.algo.txttbl.o build/release/cpp.lib.algo.u128.o build/release/cpp.lib.algo.url.o build/release/cpp.lib.algo.uuid.o build/release/cpp.lib.algo.win32.o && ranlib build/release/algo_lib-x86_64.a.tmp
mv -f build/release/algo_lib-x86_64.a.tmp build/release/algo_lib-x86_64.a
rm -f build/release/abt.tmp
-g++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+g++ build/release/cpp.abt.build.o build/release/cpp.abt.disas.o build/release/cpp.abt.main.o build/release/cpp.abt.ood.o build/release/cpp.abt.opt.o build/release/cpp.abt.scan.o build/release/cpp.gen.abt_gen.o -o build/release/abt.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/abt.tmp build/release/abt
ln -sf ../build/release/abt bin/abt
rm -f build/release/gcache.tmp
-g++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -lcrypto -ldl -lm build/release/algo_lib-x86_64.a
+g++ build/release/cpp.gcache.gcache.o build/release/cpp.gen.gcache_gen.o -o build/release/gcache.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -lcrypto -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/gcache.tmp build/release/gcache
ln -sf ../build/release/gcache bin/gcache
rm -f build/release/src_func.tmp
-g++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+g++ build/release/cpp.gen.src_func_gen.o build/release/cpp.src_func.edit.o build/release/cpp.src_func.fileloc.o build/release/cpp.src_func.header.o build/release/cpp.src_func.iffy.o build/release/cpp.src_func.list.o build/release/cpp.src_func.main.o build/release/cpp.src_func.nextfile.o build/release/cpp.src_func.scan.o -o build/release/src_func.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_func.tmp build/release/src_func
ln -sf ../build/release/src_func bin/src_func
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/gen/lib_git_gen.cpp -o build/release/cpp.gen.lib_git_gen.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
-g++ -Wno-invalid-offsetof -ffunction-sections -fdata-sections -Wsequence-point -Wno-multichar -Wall -Wshadow -pipe -Wextra -Winit-self -Wmissing-include-dirs -Wmissing-declarations -Winvalid-pch -iquote . -Wno-vla -fpch-preprocess -Wno-class-memaccess -Wpedantic -c cpp/lib/lib_git.cpp -o build/release/cpp.lib.lib_git.o -msse4.2 -D AOS_SSE42 -O3 -Werror -Wno-unused-local-typedefs -Wno-long-long -Wno-cast-function-type
rm -f build/release/lib_git-x86_64.a.tmp
ar cr build/release/lib_git-x86_64.a.tmp build/release/cpp.gen.lib_git_gen.o build/release/cpp.lib.lib_git.o && ranlib build/release/lib_git-x86_64.a.tmp
mv -f build/release/lib_git-x86_64.a.tmp build/release/lib_git-x86_64.a
rm -f build/release/src_hdr.tmp
-g++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a -ldl -lm build/release/algo_lib-x86_64.a
+g++ build/release/cpp.gen.src_hdr_gen.o build/release/cpp.src_hdr.hdr.o -o build/release/src_hdr.tmp -pthread -Wl,--gc-sections -pthread build/release/algo_lib-x86_64.a build/release/lib_json-x86_64.a build/release/lib_json-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a build/release/algo_lib-x86_64.a build/release/algo_lib-x86_64.a build/release/lib_git-x86_64.a -ldl -lm -lstdc++ build/release/algo_lib-x86_64.a
mv -f build/release/src_hdr.tmp build/release/src_hdr
ln -sf ../build/release/src_hdr bin/src_hdr
diff --git a/bin/break-long-lines b/bin/break-long-lines
index d63ebdf3..00597a16 100755
--- a/bin/break-long-lines
+++ b/bin/break-long-lines
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/check-json.mjs b/bin/check-json.mjs
new file mode 100755
index 00000000..47bfb693
--- /dev/null
+++ b/bin/check-json.mjs
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+// Copyright (C) 2025-2026 AlgoRND
+//
+// Check that file contains a valid JSON object
+
+'use strict';
+
+import * as fs from 'fs';
+
+// Get file path from command line argument
+const filePath = process.argv[2];
+
+if (!filePath) {
+ console.error('Usage: check-json.mjs ');
+ process.exit(1);
+}
+
+try {
+ const data = fs.readFileSync(filePath, 'utf-8');
+ JSON.parse(data);
+} catch (err) {
+ console.error(`Invalid ${filePath}:`, err.message);
+ process.exit(1);
+}
+
+process.exit(0);
diff --git a/bin/ci-show-log b/bin/ci-show-log
index 3b8742e4..b5c7b64e 100755
--- a/bin/ci-show-log
+++ b/bin/ci-show-log
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/core-decode b/bin/core-decode
new file mode 100755
index 00000000..978f6f49
--- /dev/null
+++ b/bin/core-decode
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# find latest file in current folder decode it
+
+set -e
+
+# Parameters
+silent=${1:-0} # 1 = silent, 0 = normal
+core_dir=${2:-.} # directory to search for core files
+
+# Find newest core file in specified directory
+core=$(find "$core_dir" -maxdepth 1 -type f -name "core.*" -printf "%T@ %p\n" 2>/dev/null \
+ | sort -nr | head -1 | awk '{print $2}')
+
+if [ -z "$core" ]; then
+ if [ "$silent" -ne 1 ]; then
+ echo "no core file found in $core_dir"
+ fi
+ exit 1
+fi
+
+echo "core found: $core"
+
+# Extract exe name from filename: core..pid.ts
+exe=$(basename "$core" | cut -d'.' -f2)
+echo "exe: $exe"
+
+# Find matching executable in local system
+bin=$(find . -type f -executable -name "$exe" -print -quit)
+[ -z "$bin" ] && { echo "binary $exe not found"; exit 1; }
+echo "binary: $bin"
+
+# Determine decoded file location in the same folder as core
+core_folder=$(dirname "$core")
+decoded_core="$core_folder/decoded_core.log"
+
+# Decode
+gdb --batch \
+ -ex "thread apply all bt full" \
+ "$bin" "$core" \
+ > "$decoded_core" 2>&1
+
+# Exclude warnings / empty lines
+# grep -v "Can't open file" "$decoded_core" | grep -v '^$'
+echo "decoded core saved to: $decoded_core"
diff --git a/bin/cpp-indent b/bin/cpp-indent
index dd2b2cc2..d190bdfc 100755
--- a/bin/cpp-indent
+++ b/bin/cpp-indent
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2016 NYSE | Intercontinental Exchange
#
# License: GPL
diff --git a/bin/delete-duplicate-lines b/bin/delete-duplicate-lines
index 091f6972..e3a0cd78 100755
--- a/bin/delete-duplicate-lines
+++ b/bin/delete-duplicate-lines
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/diff-to-errlist b/bin/diff-to-errlist
index a637ca63..0e4dbfc4 100755
--- a/bin/diff-to-errlist
+++ b/bin/diff-to-errlist
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/edit-conflicts b/bin/edit-conflicts
index 038b14f3..6f244a35 100755
--- a/bin/edit-conflicts
+++ b/bin/edit-conflicts
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/em b/bin/em
index 0a58c945..a9d81744 100755
--- a/bin/em
+++ b/bin/em
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/errlist b/bin/errlist
index aa62da64..ec890dac 100755
--- a/bin/errlist
+++ b/bin/errlist
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2024 AlgoRND
+# Copyright (C) 2024-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
#
# License: GPL
diff --git a/bin/ff b/bin/ff
index 3f554567..05e0607d 100755
--- a/bin/ff
+++ b/bin/ff
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2022 Astra
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -36,8 +36,7 @@ my @linepat = ();
my @pathpat = (
'!'.
join('|',
- ('^\.svn/'
- ,'^build/'
+ ('^build/'
,'^temp/'
,'^\.git/'))
);
@@ -143,9 +142,7 @@ if ($wholeword) {
if ($no_autogen) {
push(@pathpat, "!/gen/");
- push(@pathpat, "!apssuite/");
push(@pathpat, "!extern/");
- push(@pathpat, "!temp/");
}
if (!@dirs) {
diff --git a/bin/filt-gc b/bin/filt-gc
new file mode 100755
index 00000000..247f616a
--- /dev/null
+++ b/bin/filt-gc
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+
+N=$(cat test/filt.sed | wc -l)
+for ((i=N; i>0; i--)); do
+ echo "trying to remove line #$i"
+ cp "test/filt.sed" "temp/filt.bak"
+ sed -i "${i}d" "test/filt.sed"
+ atf_comp -capture % >/dev/null 2>/dev/null
+ mod=$(git ls-files -m "test/atf_comp/")
+ if [ "$mod" != "" ]; then
+ mv "temp/filt.bak" "test/filt.sed"
+ else
+ echo "success - line unused"
+ fi
+ git checkout "test/atf_comp"
+done
diff --git a/bin/find-non-copyrighted b/bin/find-non-copyrighted
index d04f4dab..689df330 100755
--- a/bin/find-non-copyrighted
+++ b/bin/find-non-copyrighted
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/fix-gen-conflicts b/bin/fix-gen-conflicts
index d51df098..6f5daca1 100755
--- a/bin/fix-gen-conflicts
+++ b/bin/fix-gen-conflicts
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2022 Astra
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/bin/gdb_pretty_print.py b/bin/gdb_pretty_print.py
new file mode 100644
index 00000000..7337bda7
--- /dev/null
+++ b/bin/gdb_pretty_print.py
@@ -0,0 +1,105 @@
+# Copyright (C) 2025 AlgoRND
+#
+# License: GPL
+# helper script for gdb to print algo::aryptr, algo::strptr, algo::cstring, algo::Smallstr
+
+# to invoke add this to your .gdbinit file:python
+# import gdb_pretty_print
+# end
+
+# Cannot be run outside of gdb python environment
+import gdb
+import gdb.printing
+
+# Debug print to confirm loading
+print("Loading aryptr_printer.py")
+
+# convert to horizontal display
+def display(n_elems, elems):
+ if n_elems == 0:
+ return "len=0:"
+ if n_elems < 0:
+ try:
+ return "len=" + str(int(n_elems)) + "(garbage):"
+ except Exception as e:
+ return "len=unknown(garbage):" # Fallback in case of error
+ if not elems:
+ return "nullptr"
+
+ # protect against garbage values
+ lim=400
+ if n_elems > lim:
+ try:
+ len_caption= str(n_elems) + " trunc at " + str(lim)
+ except Exception as e:
+ len_caption="len=unknown(garbage):" # Fallback in case of error
+ n_elems = lim
+ else:
+ len_caption= str(n_elems)
+
+ try:
+ # Read exactly n_elems characters as raw bytes
+ chars = []
+ for i in range(n_elems):
+ # Read 1 byte from memory
+ mem = gdb.selected_inferior().read_memory(elems + i, 1)
+ byte = ord(mem.tobytes()) # convert to int
+ if 32 <= byte < 127:
+ chars.append(mem.tobytes().decode('utf-8', errors='ignore'))
+ else:
+ chars.append('.')
+
+ tmp_str= ''.join(chars)
+ return "len="+len_caption+":"+tmp_str
+ except Exception as e:
+ return str(e)
+
+# ------
+class AryPtrPrinter:
+ def __init__(self, val):
+ self.val = val
+ def to_string(self):
+ return display(int(self.val['n_elems']),self.val['elems'])
+ def display_hint(self):
+ return 'string'
+
+def AryPtrPrinter_build():
+ pp = gdb.printing.RegexpCollectionPrettyPrinter("aryptr")
+ # Match algo::aryptr and algo::strptr
+ pp.add_printer('aryptr', '^algo::aryptr$|^algo::strptr$', AryPtrPrinter)
+ return pp
+# ------
+class CstringPrinter:
+ def __init__(self, val):
+ self.val = val
+ def to_string(self):
+ return display(int(self.val['ch_n']), self.val['ch_elems'])
+ def display_hint(self):
+ return 'string'
+
+def CstringPrinter_build():
+ pp = gdb.printing.RegexpCollectionPrettyPrinter("cstring")
+ # Match algo::strptr and algo::cstring
+ pp.add_printer('cstring', '^algo::cstring$|^algo::tempstr$', CstringPrinter)
+ return pp
+# ------
+class SmallstrPrinter:
+ def __init__(self, val):
+ self.val = val
+ def to_string(self):
+ # unclear why int() is needed
+ return display(int(self.val['n_ch']), int(self.val['ch'].address))
+ def display_hint(self):
+ return 'string'
+
+def SmallstrPrinter_build():
+ pp = gdb.printing.RegexpCollectionPrettyPrinter("smallstr")
+ # Match algo::Smallstr*
+ pp.add_printer('smallstr','.*Smallstr.*', SmallstrPrinter)
+ return pp
+
+
+# Register the pretty printers
+gdb.printing.register_pretty_printer(None, CstringPrinter_build(), replace=True)
+gdb.printing.register_pretty_printer(None, AryPtrPrinter_build(), replace=True)
+gdb.printing.register_pretty_printer(None, SmallstrPrinter_build(), replace=True)
diff --git a/bin/git-add-to-last-commit b/bin/git-add-to-last-commit
index f2e22810..2544a381 100755
--- a/bin/git-add-to-last-commit
+++ b/bin/git-add-to-last-commit
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-branch-gc b/bin/git-branch-gc
index ade82515..42f764ce 100755
--- a/bin/git-branch-gc
+++ b/bin/git-branch-gc
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-checkout-master b/bin/git-checkout-master
new file mode 100755
index 00000000..56d0b174
--- /dev/null
+++ b/bin/git-checkout-master
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# License: GPL
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+git checkout master
diff --git a/bin/git-clean-branches b/bin/git-clean-branches
index e8d90e3b..05884df0 100755
--- a/bin/git-clean-branches
+++ b/bin/git-clean-branches
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
#
# License: GPL
diff --git a/bin/git-commits-per-user b/bin/git-commits-per-user
index 5954cdb6..479a7940 100755
--- a/bin/git-commits-per-user
+++ b/bin/git-commits-per-user
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-current-ref b/bin/git-current-ref
index a9a36d24..a25b81e2 100755
--- a/bin/git-current-ref
+++ b/bin/git-current-ref
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-diff-annotate b/bin/git-diff-annotate
index 8b68542a..c57eeac8 100755
--- a/bin/git-diff-annotate
+++ b/bin/git-diff-annotate
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
#
diff --git a/bin/git-grep-reflog b/bin/git-grep-reflog
index 26427bcf..5e7fbb3c 100755
--- a/bin/git-grep-reflog
+++ b/bin/git-grep-reflog
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-mdiff b/bin/git-mdiff
index e3ecc81c..34109781 100755
--- a/bin/git-mdiff
+++ b/bin/git-mdiff
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -20,5 +20,5 @@
(
git diff --color=always HEAD~ --stat | grep -v /gen/
- git diff -w -U6 $* HEAD~ include cpp data | grephunk f:'!/gen/' | hilite -d
+ git diff -w -U6 $* HEAD~ include cpp data | grephunk f:'!/gen/' f:!'dispsig.ssim' | hilite -d
) | less -r
diff --git a/bin/git-mod-plot b/bin/git-mod-plot
index 6905aae9..edef6ae7 100755
--- a/bin/git-mod-plot
+++ b/bin/git-mod-plot
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-praise b/bin/git-praise
index 96a0913e..334510c4 100755
--- a/bin/git-praise
+++ b/bin/git-praise
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-rebase-origin b/bin/git-rebase-origin
index 10767536..61b13631 100755
--- a/bin/git-rebase-origin
+++ b/bin/git-rebase-origin
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -17,12 +17,3 @@
#
git-rebase-remote origin
-# git fetch origin
-# BRANCH=master
-# # do this as a single command so that if reset fails, there is no commit attempt.
-# git reset --soft $(git merge-base HEAD origin/$BRANCH) && (
-# git commit -m "$(git log --format=%B --reverse HEAD..HEAD@{1})"
-# git commit --amend # allow editing comment
-# )
-# # keep-empty is needed so that base commit gets integrated
-# git rebase --keep-empty --strategy=recursive origin/$BRANCH
diff --git a/bin/git-rebase-remote b/bin/git-rebase-remote
index 21c11085..2accba72 100755
--- a/bin/git-rebase-remote
+++ b/bin/git-rebase-remote
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -33,8 +33,8 @@ echo "rebasing to remote:"$ORIGIN "branch:"$BRANCH
git fetch $ORIGIN
# do this as a single command so that if reset fails, there is no commit attempt.
git reset --soft $(git merge-base HEAD $ORIGIN/$BRANCH) && (
- git commit -m "$(git log --format=%B --reverse HEAD..HEAD@{1})"
- git commit --amend # allow editing comment
+ git commit --allow-empty -m "$(git log --format=%B --reverse HEAD..HEAD@{1})"
+ git commit --allow-empty --amend # allow editing comment
)
# keep-empty is needed so that base commit gets integrated
git rebase --keep-empty --strategy=recursive $ORIGIN/$BRANCH
diff --git a/bin/git-recent-branches b/bin/git-recent-branches
index bd02fddd..e11a6811 100755
--- a/bin/git-recent-branches
+++ b/bin/git-recent-branches
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-rollback-file b/bin/git-rollback-file
index 39cae535..d60ab3ef 100755
--- a/bin/git-rollback-file
+++ b/bin/git-rollback-file
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/git-update-config b/bin/git-update-config
index 812a9ae1..fc60c3dc 100755
--- a/bin/git-update-config
+++ b/bin/git-update-config
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/gitconfig-setup b/bin/gitconfig-setup
index 64067acb..88a8c011 100755
--- a/bin/gitconfig-setup
+++ b/bin/gitconfig-setup
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2024 AlgoRND
+# Copyright (C) 2024-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/grephunk b/bin/grephunk
index 58bb671c..1f1d6c9e 100755
--- a/bin/grephunk
+++ b/bin/grephunk
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
#
diff --git a/bin/hilite b/bin/hilite
index a57a33f4..20059d7c 100755
--- a/bin/hilite
+++ b/bin/hilite
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/hilite-error b/bin/hilite-error
index 541a019b..95f7ce70 100755
--- a/bin/hilite-error
+++ b/bin/hilite-error
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/jkv b/bin/jkv
new file mode 120000
index 00000000..0e2ff231
--- /dev/null
+++ b/bin/jkv
@@ -0,0 +1 @@
+../build/release/jkv
\ No newline at end of file
diff --git a/bin/limit-output b/bin/limit-output
index 1b393d8f..9a1c2fc9 100755
--- a/bin/limit-output
+++ b/bin/limit-output
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/lines-to-dots b/bin/lines-to-dots
index f6c0e9e0..1efa7197 100755
--- a/bin/lines-to-dots
+++ b/bin/lines-to-dots
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/lsfunc b/bin/lsfunc
index dcfd924e..f6fc1713 100755
--- a/bin/lsfunc
+++ b/bin/lsfunc
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/msloc.pl b/bin/msloc.pl
index 5bcd9153..12d746fa 100755
--- a/bin/msloc.pl
+++ b/bin/msloc.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2012 AlgoEngineering LLC
#
diff --git a/bin/nogen b/bin/nogen
index a804142f..5a3ae7fd 100755
--- a/bin/nogen
+++ b/bin/nogen
@@ -1 +1 @@
-grephunk 'f:!/gen/' | hilite -d | less -r
+grephunk 'f:!/gen/' 'f:!internals.md' | hilite -d | less -r
diff --git a/bin/normalize b/bin/normalize
index 982e3e12..c56e6b54 100755
--- a/bin/normalize
+++ b/bin/normalize
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -19,5 +19,5 @@
set -o pipefail
set -e
job="${1:-normalize}"
-echo "# Running tests: $(bin/acr atfdb.citest.cijob:$job -field citest | tr '\n' ',')"
-(bin/ai && bin/atf_ci -cijob:"${job}") 2>&1 | bin/hilite -e
+echo "# Running tests: $(acr atfdb.citest.cijob:$job -field citest | tr '\n' ',')"
+(ai && atf_ci -cijob:"${job}") 2>&1 | hilite -e
diff --git a/bin/normalize_loop b/bin/normalize_loop
new file mode 100755
index 00000000..332df35e
--- /dev/null
+++ b/bin/normalize_loop
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
+#
+# Run normilize multiple times till it passes
+# while true; do normalize && break || { echo "Normalize failed! Amending last commit..."; git-add-to-last-commit; sleep 1; }; done
+
+max_tries=10
+try_count=0
+
+while [ $try_count -lt $max_tries ]; do
+ ((try_count++))
+ echo "Attempt $try_count: Running 'normalize'..."
+
+ if normalize; then
+ echo "Success after $try_count tries!"
+ break
+ else
+ echo "Normalize failed! Amending last commit and retrying..."
+ git-add-to-last-commit
+ fi
+done
diff --git a/bin/open-link b/bin/open-link
new file mode 100755
index 00000000..1ce82c87
--- /dev/null
+++ b/bin/open-link
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+
+if [ -z "$RMTAGENT" ]; then
+ echo "RMTAGENT not set. Please set RMTAGENT to ip:port"
+ exit 1
+fi
+
+IFS=':' read -r ip port <<< "$RMTAGENT"
+cat - | nc "$ip" "$port"
diff --git a/bin/revert-executable b/bin/revert-executable
new file mode 100755
index 00000000..0dd27c43
--- /dev/null
+++ b/bin/revert-executable
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# revert an executable to specified ref
+# (e.g. restore-target amc MERGE_HEAD)
+
+TGT=$1
+REF=$2
+if [ -z "$TGT" ] || [ -z "$REF" ]; then
+ echo "usage: $0 ["
+ exit 1
+fi
+sandbox amc -reset -ref $REF -- bash -c "abt $TGT" && cp temp/sandbox.amc/build/release/$TGT build/release/
diff --git a/bin/samp_make b/bin/samp_make
new file mode 120000
index 00000000..2754dcef
--- /dev/null
+++ b/bin/samp_make
@@ -0,0 +1 @@
+../build/release/samp_make
\ No newline at end of file
diff --git a/bin/select-bootstrap b/bin/select-bootstrap
index bdb34816..b2a87a62 100755
--- a/bin/select-bootstrap
+++ b/bin/select-bootstrap
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2022 Astra
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -32,7 +32,7 @@ my $cfg="release";
my $rc=0;
my $found=0;
my $builddir;
-for my $compiler ('g++', 'clang++') {
+for my $compiler ('clang++', 'g++') {
$builddir = "$uname-$compiler.$cfg-$arch";
print "# considering $builddir\n";
my $bsfile = "bin/bootstrap/$builddir";
diff --git a/bin/sha1 b/bin/sha1
index 32ea1658..f93d3e5b 100755
--- a/bin/sha1
+++ b/bin/sha1
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/sloc.pl b/bin/sloc.pl
index afd82529..b4cb49a2 100755
--- a/bin/sloc.pl
+++ b/bin/sloc.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2012 AlgoEngineering LLC
#
diff --git a/bin/sortwrap b/bin/sortwrap
new file mode 100755
index 00000000..f19605c7
--- /dev/null
+++ b/bin/sortwrap
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# License: GPL
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+set -o pipefail
+
+usage() {
+ cat <<'EOF'
+Usage:
+ sortwrap [SORT_OPTS ...] -- COMMAND [ARGS...]
+ sortwrap [SORT_OPTS ...] COMMAND [ARGS...]
+
+Description:
+ Runs COMMAND and sorts its stdout with 'sort'. Any arguments before the first
+ non-option or explicit -- are passed directly to sort (e.g. -n, -r, -u, -k2,2).
+
+Notes:
+ • stderr from COMMAND is not sorted and is passed through unchanged.
+ • Exit status is COMMAND's if it failed, otherwise sort's.
+ • On macOS/BSD, use '-r' instead of '--reverse'.
+
+Examples:
+ sortwrap -- ls -1
+ sortwrap -n -r -- seq 1 10
+ sortwrap -k2,2 awk '{print $2, $1}' file.txt
+EOF
+}
+
+SORT_OPTS=()
+if (( $# == 0 )); then usage >&2; exit 2; fi
+
+# Collect sort options up to '--' or first non-option
+while (( $# )); do
+ case "$1" in
+ -h|--help) usage; exit 0 ;;
+ --) shift; break ;;
+ -*) SORT_OPTS+=("$1"); shift ;;
+ *) break ;;
+ esac
+done
+
+if (( $# == 0 )); then
+ echo "Error: missing COMMAND. Put -- before the command if you used sort options." >&2
+ usage >&2
+ exit 2
+fi
+
+# Run COMMAND | sort with selected options
+"$@" | sort "${SORT_OPTS[@]}"
+# Capture both statuses safely (default to 0 if missing)
+ps=( "${PIPESTATUS[@]}" )
+cmd_status=${ps[0]:-0}
+sort_status=${ps[1]:-0}
+
+# Prefer the command's failure code, otherwise sort's
+if (( cmd_status != 0 )); then
+ exit "$cmd_status"
+else
+ exit "$sort_status"
+fi
diff --git a/bin/stepper b/bin/stepper
new file mode 100755
index 00000000..011b24f2
--- /dev/null
+++ b/bin/stepper
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# usage: command1 | stepper | command2
+# this reaads lines from command1, allows editing them, then sends to command2
+
+while IFS= read -r line; do
+ sleep 0.2
+ printf "\n" > /dev/tty
+ read -e -i "$line" -p "> " edited < /dev/tty > /dev/tty 2>&1
+ # erase current line
+ # printf "\033[1A\033[2K" > /dev/tty
+ printf '%s\n' "$edited"
+done
diff --git a/bin/tags b/bin/tags
index 2adbc485..521228e7 100755
--- a/bin/tags
+++ b/bin/tags
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/targ-diff b/bin/targ-diff
index 63cb9392..530efdcc 100755
--- a/bin/targ-diff
+++ b/bin/targ-diff
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
#
diff --git a/bin/test-orgfile b/bin/test-orgfile
index 1eab14f4..ac1bc0ba 100755
--- a/bin/test-orgfile
+++ b/bin/test-orgfile
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2022 Astra
#
# License: GPL
diff --git a/bin/timestamps b/bin/timestamps
index 3dbe4174..682ce030 100755
--- a/bin/timestamps
+++ b/bin/timestamps
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/toamc b/bin/toamc
index 82c2eff6..3e6f6852 100755
--- a/bin/toamc
+++ b/bin/toamc
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2022 Astra
# Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/bin/todo b/bin/todo
index 92a4da8c..4a802f0d 100755
--- a/bin/todo
+++ b/bin/todo
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/update-gitfile b/bin/update-gitfile
index 678ca634..a4e1efd1 100755
--- a/bin/update-gitfile
+++ b/bin/update-gitfile
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
#
# License: GPL
diff --git a/bin/update-hdr b/bin/update-hdr
index 99a4e0df..a06f5bbf 100755
--- a/bin/update-hdr
+++ b/bin/update-hdr
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
diff --git a/bin/update-scriptfile b/bin/update-scriptfile
index c52a9bf2..569bdfdf 100755
--- a/bin/update-scriptfile
+++ b/bin/update-scriptfile
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright (C) 2023-2024 AlgoRND
+#!/usr/bin/env bash
+# Copyright (C) 2023-2026 AlgoRND
#
# License: GPL
# This program is free software: you can redistribute it and/or modify
@@ -16,17 +16,4 @@
# along with this program. If not, see .
#
-(
- # delete commands for all scriptfiles
- acr scriptfile -cmd 'echo acr.delete dev.scriptfile gitfile:"$gitfile"' | bash
- # search for them again -- this undoes the deletion
- # -L follows symlinks
- for X in $(find bin -exec file -L {} \; | egrep -i script | cut -f1 -d: | egrep -v "(~$|bin/bootstrap/)"); do
- echo dev.scriptfile gitfile:$X
- done
- for X in $(find bin -type f -executable | grep -v \~); do
- if head -1 $X | grep python >/dev/null; then
- echo dev.scriptfile gitfile:$X
- fi
- done
-) | acr -merge -write -print:N
+atf_ci update_script -check_clean:N
diff --git a/bin/vscode-select-debug-target b/bin/vscode-select-debug-target
new file mode 100755
index 00000000..fd5e77fc
--- /dev/null
+++ b/bin/vscode-select-debug-target
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# Copyright (C) 2025-2026 AlgoRND
+#
+# Select target script for VSCODE, which knows only source file name, which is open in editor.
+# We have to compute target, build it, and symlink it with well-known name e.g. temp/a.out
+# VSCODE task command example: "vscode-select-debug-target ${file} temp/a.out"
+
+set -e
+SRCFILE=$1
+LINK=$2
+TGT=$(acr dev.targsrc:%/${SRCFILE##$(realpath $PWD)/} -report:N -field:target)
+TGT=${TGT:+$(acr dmmeta.ns:$TGT -where:nstype:exe -report:N -field:ns)}
+[[ -e $LINK ]] && TGT=${TGT:-$(basename `realpath $LINK`)}
+[[ -n $TGT ]]
+rm -f $LINK
+ln -s ../build/debug/$TGT $LINK
diff --git a/bin/zfs_snapshot.pl b/bin/zfs_snapshot.pl
index 73220038..cd86ddb3 100755
--- a/bin/zfs_snapshot.pl
+++ b/bin/zfs_snapshot.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# Copyright (C) 2023-2024 AlgoRND
+# Copyright (C) 2023-2026 AlgoRND
# Copyright (C) 2013-2014 NYSE | Intercontinental Exchange
# Copyright (C) 2008-2012 AlgoEngineering LLC
#
diff --git a/conf/alexei/bash_profile b/conf/alexei/bash_profile
index cb7fbe91..bc537782 100644
--- a/conf/alexei/bash_profile
+++ b/conf/alexei/bash_profile
@@ -18,9 +18,9 @@ if [ "$PS1" != "" ]; then
PS1="\e[0;34m[\$? \D{%b %d %H:%M:%S}] \u@$HOSTNAME\e[0;32m:\w\e[m \n\$ "
LS_OPTIONS='--color=auto --quoting-style=shell'
- cd $(dirname $(dirname $(dirname "$(readlink ~/.bash_profile)")))
- $(bin/acr_compl -install)
- cd - >/dev/null
+ PREV="$PWD"
+ cd $(dirname $(dirname $(dirname "$(readlink -f ~/.bash_profile)"))) 2>/dev/null && $(bin/acr_compl -install)
+ cd "$PREV"
fi
# acr_compl -install needs a list of executables to work
diff --git a/conf/emacs.el b/conf/emacs.el
index 49d29d78..28a22d83 100644
--- a/conf/emacs.el
+++ b/conf/emacs.el
@@ -82,38 +82,6 @@
(insert "\\end{verbatim}\n")
)
-;;
-;; jira-code
-;;
-(defun jira-code ()
- "Wrap region in jira code block"
- (interactive)
- (point-to-register 1)
- (exchange-point-and-mark)
- (insert "{code}\n")
- (jump-to-register 1)
- (insert "{code}\n")
- )
-
-;;
-;; jira-before-after
-;;
-(defun jira-before-after ()
- "Create a rewrite block"
- (interactive)
- (kill-ring-save (point) (mark))
- (point-to-register 1)
- (exchange-point-and-mark)
- (insert "Before:\n")
- (insert "{code}\n")
- (jump-to-register 1)
- (insert "{code}\n")
- (insert "After:\n")
- (insert "{code}\n")
- (yank)
- (insert "{code}\n")
- )
-
;;
;; consider _ as part of identifier
;; use font colors
@@ -202,6 +170,11 @@
("\\.ssim$" . ssim-mode)
("\\.md$" . markdown-mode)
("\\.markdown$" . markdown-mode)
+ ("\\.jx$" . javascript-mode)
+ ("\\.jsx$" . javascript-mode)
+ ("\\.mjs$" . javascript-mode)
+ ("\\.ts$" . javascript-mode)
+ ("\\.tsx$" . javascript-mode)
) auto-mode-alist))
(autoload 'markdown-mode "markdown-mode"
@@ -310,23 +283,9 @@
(fset 'compile-show-output
"\C-x1\C-x2\C-xo\C-xb*comp\C-i\C-m\C-[>\C-xo")
-;;-----------------------------------------------------------------------------
-;; gnome work-around
-;; what does this do exactly?
-
-(define-key function-key-map "\eO1;2P" [(shift f1)])
-(define-key function-key-map "\eO1;2Q" [(shift f2)])
-(define-key function-key-map "\eO1;2R" [(shift f3)])
-(define-key function-key-map "\eO1;2S" [(shift f4)])
-
-(define-key function-key-map "\eO1;5P" [(control f1)])
-(define-key function-key-map "\eO1;5Q" [(control f2)])
-(define-key function-key-map "\eO1;5R" [(control f3)])
-(define-key function-key-map "\eO1;5S" [(control f4)])
-
;;------------------------------------------------------------------------------
-; strip 'Directory '
+ ; strip 'Directory '
(setq compile-command (concat "cd " ffroot-directory " && ai % 2>&1 | break-long-lines"))
(setq-default c-basic-offset 4)
@@ -356,21 +315,16 @@
;; visual studio's alt-2 command
(global-set-key (kbd "M-2") 'compile-show-output)
-(global-set-key (kbd "") 'bm-next)
-(global-set-key (kbd "C-") 'bm-bookmark-line)
-
+(global-set-key (kbd "") 'grep-find)
(global-set-key (kbd "") 'ff-word)
(global-set-key (kbd "C-") 'ff-word-with-generated-code)
-(global-set-key (kbd "") 'ff-try-to-find-function-definition)
-(global-set-key (kbd "S-") 'previous-error)
(global-set-key (kbd "") 'next-error)
-(global-set-key (kbd "C-") 'kill-current-buffer)
+(global-set-key (kbd "C-") 'previous-error)
(global-set-key (kbd "C-") 'next-buffer)
(global-set-key (kbd "") 'previous-buffer)
-(global-set-key (kbd "M-") 'trim-and-indent-region)
(global-set-key (kbd "C-M-\\") 'trim-and-indent-region)
(global-set-key (kbd "C-") 'beginning-of-buffer)
@@ -379,7 +333,6 @@
(global-set-key (kbd "C-") 'kill-word)
(global-set-key (kbd "C-") 'electric-buffer-list)
(global-set-key (kbd "C-\\") 'bury-buffer)
-(global-set-key (kbd "C-.") 'complete-symbol)
(global-set-key (kbd "M-o") 'algo-ff-toggle-source)
(global-set-key (kbd "M-p") 'algo-ff-open-other)
(global-set-key (kbd "C-%") 'query-replace-regexp)
@@ -388,13 +341,16 @@
;; debugger commands
(global-set-key (kbd "") 'gud-step) ;step into
-(global-set-key (kbd "S-") 'gud-finish) ;step out of function
+(global-set-key (kbd "C-") 'gud-finish) ;step out of function
+
(global-set-key (kbd "") 'gud-next) ;step over
-(global-set-key (kbd "C-") 'gud-until) ;go until current line
(global-set-key (kbd "") 'gdb-restore-windows)
-(global-set-key (kbd "") 'gud-cont) ;run
-(global-set-key (kbd "") 'gud-break) ;set breakpoint
-(global-set-key (kbd "C-") 'gud-remove) ;clear breakpoint
+(global-set-key (kbd "") 'gud-cont) ; run
+(global-set-key (kbd "C-") (lambda () (interactive) (gud-call "start")))
+
+(global-set-key (kbd "") 'gud-break) ; set breakpoint
+(global-set-key (kbd "M-") (lambda () (interactive) (gud-call "del")))
+(global-set-key (kbd "C-") 'gud-until) ;go until current line
(global-set-key (kbd "M-") 'gud-down)
(global-set-key (kbd "M-S-") 'gud-up)
diff --git a/conf/gdb.py b/conf/gdb.py
new file mode 100644
index 00000000..ef9609bb
--- /dev/null
+++ b/conf/gdb.py
@@ -0,0 +1,27 @@
+import gdb
+import os
+
+# add command to list inferiors
+class Ps(gdb.Command):
+ """List all inferiors with their full command lines."""
+
+ def __init__(self):
+ super(Ps, self).__init__("ps",gdb.COMMAND_USER)
+
+ def invoke(self, arg, from_tty):
+ for inferior in gdb.inferiors():
+ pid = inferior.pid
+ if pid is None:
+ cmdline = ""
+ else:
+ try:
+ with open(f"/proc/{pid}/cmdline", "rb") as f:
+ raw = f.read().decode(errors="replace")
+ # cmdline is null-separated
+ cmdline = " ".join(raw.split("\0")).strip()
+ except Exception as e:
+ cmdline = f""
+
+ print(f"Inferior {inferior.num} (PID {pid}): {cmdline}")
+
+Ps()
diff --git a/cpp/abt/build.cpp b/cpp/abt/build.cpp
index 98702322..fe766539 100644
--- a/cpp/abt/build.cpp
+++ b/cpp/abt/build.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
diff --git a/cpp/abt/disas.cpp b/cpp/abt/disas.cpp
index 2aeeba01..994f6176 100644
--- a/cpp/abt/disas.cpp
+++ b/cpp/abt/disas.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/abt/main.cpp b/cpp/abt/main.cpp
index e0981682..be583c5f 100644
--- a/cpp/abt/main.cpp
+++ b/cpp/abt/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -132,7 +132,7 @@ tempstr abt::GetObjpath(abt::FBuilddir &builddir, abt::FSrcfile &srcfile) {
// Replace extension
strptr tgt_ext;
strptr ext = GetFileExt(srcfile.srcfile);
- if (ext == ".cpp" || ext == ".c") {
+ if (ext == ".cpp" || ext == ".c" || ext == ".cc") {
tgt_ext = builddir.p_compiler->objext;
} else if (ext == ".rc" && builddir.p_compiler->rc != "") {
tgt_ext = ".res";
@@ -344,7 +344,7 @@ static void Main_CreateCmds(abt::FBuilddir &builddir, abt::FSyscmd *start, abt::
}ind_end;
// if a source file filter as specified, do not perform link step
- bool canlink = abt::_db.cmdline.srcfile.accepts_all;
+ bool canlink = accepts_all_Get(abt::_db.cmdline.srcfile.flags);
// link step
if (abt::_db.cmdline.build && target.ood && canlink) {
@@ -459,13 +459,11 @@ static void Main_GuessParams() {
// -----------------------------------------------------------------------------
static void CreateTmpdir() {
- errno_vrfy(algo::CreateDirRecurse("temp")
- ,tempstr()<<"abt.createdir"
- <objkey = abt::GetObjkey(srcfile->srcfile);
// read file, scan includes
- if (!algo::StartsWithQ(srcfile->srcfile,"extern/")) {
- ScanHeaders(srcfile);
- }
+ ScanHeaders(srcfile);
abt::zs_srcfile_read_RemoveFirst();
}
}
diff --git a/cpp/abt_md/file_section.cpp b/cpp/abt_md/file_section.cpp
index ee2967e5..4b97bd06 100644
--- a/cpp/abt_md/file_section.cpp
+++ b/cpp/abt_md/file_section.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2024 AlgoRND
+// Copyright (C) 2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -41,14 +41,14 @@ void abt_md::CheckSection(abt_md::FFileSection &file_section) {
codeblock_start_line = codeblock_start_line ? 0 : lineno;
}
if (codeblock_start_line && backticks_start_line) {
- prlog(_db.c_readme->gitfile<<":"<gitfile<<":"< 0 && level <= title_level) {
- prlog(_db.c_readme->gitfile<<":"<gitfile<<":"<gitfile<<":"<gitfile<<":"<gitfile<<":"<gitfile<<":"<
+ if (Mdmark_ReadStrptrMaybe(mdmark,text)){
ret=EndsWithQ(mdmark.state,"_AUTO");
+ } else {
+ prerr("Marktag: failed to read string "<gitfile<<":"<<(file_section.firstline + 1 + ind_curs(line).i);
+ link.location << _db.c_readmefile->gitfile<<":"<<(file_section.firstline + 1 + ind_curs(line).i);
link.text=link_text;
link.target=link_target;
link_text="";
@@ -238,7 +243,7 @@ void abt_md::ScanLinksAnchors() {
if (StartsWithQ(line,"gitfile<<"#"<gitfile<<"#"<ns);
+ if (readmefile.p_ns) {
+ Set(_db.R,"$ns",readmefile.p_ns->ns);
}
file_section_RemoveAll();
abt_md::FFileSection *cur_section=NULL;
bool backticks=false;// inside backticks block
bool codeblock=false;// inside code block
- ind_beg(algo::FileLine_curs,line,readme.gitfile) {
+ ind_beg(algo::FileLine_curs,line,readmefile.gitfile) {
bool skip=false;
if (StartsWithQ(line,"```")) {
backticks=!backticks;
@@ -437,7 +442,7 @@ void abt_md::LoadSections(abt_md::FReadme &readme) {
cur_section->p_mdsection=&mdsection;
}
}ind_end;
- verblog(readme.gitfile<<":"<firstline
+ verblog(readmefile.gitfile<<":"<firstline
<p_mdsection ? cur_section->p_mdsection->mdsection : dev::MdsectionPkey())));
cur_section->sortkey=Sortkey(*cur_section->p_mdsection, file_section_N());
diff --git a/cpp/abt_md/main.cpp b/cpp/abt_md/main.cpp
index b1cadb87..4d6ffd16 100644
--- a/cpp/abt_md/main.cpp
+++ b/cpp/abt_md/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -24,9 +24,9 @@
// -----------------------------------------------------------------------------
-// Return true if readme file README needs section MDSECTION
-bool abt_md::NeedSectionQ(abt_md::FMdsection &mdsection, abt_md::FReadme &readme) {
- return Regx_Match(mdsection.regx_path,readme.gitfile) && mdsection.path!="";
+// Return true if readme file READMEFILE needs section MDSECTION
+bool abt_md::NeedSectionQ(abt_md::FMdsection &mdsection, abt_md::FReadmefile &readmefile) {
+ return Regx_Match(mdsection.regx_path,readmefile.gitfile) && mdsection.path!="";
}
// Extract words from line up until first dash
@@ -35,9 +35,10 @@ bool abt_md::NeedSectionQ(abt_md::FMdsection &mdsection, abt_md::FReadme &readme
// to generate anchors, but we allow '.' in anchor name
tempstr abt_md::LineKey(algo::strptr line) {
strptr str=Pathcomp(line," LR");
- int i=FindStr(str," -- ");
- if (i==-1) {
- i=FindStr(str," - ");
+ int i=FindStr(str," - ");
+ int j=FindStr(str," -- ");
+ if (i==-1 || (j!=-1 && j"<"<ns != "") {
- readme.p_ns=ns;
- ns->c_readme=&readme;
+ readmefile.p_ns=ns;
+ ns->c_readmefile=&readmefile;
}
} else if (dir1==dmmeta_Nstype_nstype_ssimdb) {
tempstr ssimfile_key(tempstr()<c_readme=&readme;
+ readmefile.p_ns = ns;
+ ns->c_readmefile=&readmefile;
} else if (abt_md::FSsimfile *ssimfile =ind_ssimfile_Find(ssimfile_key)) {
- readme.p_ssimfile=ssimfile;
- readme.p_ctype=ssimfile->p_ctype;
+ readmefile.p_ssimfile=ssimfile;
+ readmefile.p_ctype=ssimfile->p_ctype;
} else {
stray_error<c_readme=&readme;
+ readmefile.p_ns = ns;
+ ns->c_readmefile=&readmefile;
} else if (abt_md::FCtype *ctype =ind_ctype_Find(ctype_key)) {
- readme.p_ctype=ctype;
+ readmefile.p_ctype=ctype;
} else {
stray_error<gitfile));
- } else if (readme.p_ns) {
+ <gitfile));
+ } else if (readmefile.p_ns) {
verblog("abt_md.readme_ns"
- <ns));
- } else if (readme.p_ssimfile) {
+ <ns));
+ } else if (readmefile.p_ssimfile) {
verblog("abt_md.readme_ssimfile"
- <ssimfile));
+ <ssimfile));
}
}
}ind_end;
@@ -483,6 +484,22 @@ void abt_md::CheckLinks() {
}ind_end;
}
+void abt_md::ProcessReadme(abt_md::FReadmefile& readmefile) {
+ verblog("processing " << readmefile.gitfile);
+ _db.c_readmefile = &readmefile;
+ LoadSections(readmefile);
+ if (_db.cmdline.update) {
+ UpdateReadme();
+ }
+ // scan sections for links and anchors
+ ScanLinksAnchors();
+ if (_db.cmdline.print && !_db.cmdline.link && !_db.cmdline.anchor) {
+ cstring out;
+ PrintSections(out);
+ prlog(out);
+ }
+}
+
// -----------------------------------------------------------------------------
void abt_md::Main() {
@@ -505,13 +522,13 @@ void abt_md::Main() {
Main_XrefNs();
// select md files by regex or by namespace
- ind_beg(_db_readme_curs,readme,_db) {
- readme.select = _db.cmdline.ns.expr != ""
- ? (readme.p_ns && Regx_Match(_db.cmdline.ns,readme.p_ns->ns))
- : Regx_Match(_db.cmdline.readme,readme.gitfile);
+ ind_beg(_db_readmefile_curs,readmefile,_db) {
+ readmefile.select = _db.cmdline.ns.expr != ""
+ ? (readmefile.p_ns && Regx_Match(_db.cmdline.ns,readmefile.p_ns->ns))
+ : Regx_Match(_db.cmdline.readmefile,readmefile.gitfile);
- if (readme.select) {
- verblog("abt_md: select "<p_ctype) {
+ if (abt_md::FCtype *ctype = _db.c_readmefile->p_ctype) {
section.text << "* "<ctype << eol<c_ssimfile;
+ if (ret) break;
+ }
+ }ind_end;
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+
+void abt_md::PopulateScanNs(abt_md::FNs &ns) {
+ if (abt_md::FTarget *target=ns.c_target) {
+ ind_beg(abt_md::target_c_targdep_curs,targdep,*target) {
+ PopulateScanNs(*targdep.p_parent->p_ns);
+ }ind_end;
+ }
+ abt_md::zd_scanns_Insert(ns);
+}
+
+// -----------------------------------------------------------------------------
+
void abt_md::mdsection_Inputs(abt_md::FFileSection §ion) {
// Extract loaded finputs from the generated code
- abt_md::FNs *ns=_db.c_readme->p_ns;
+ abt_md::FNs *ns=_db.c_readmefile->p_ns;
if (ns) {
section.text = "";// replace section text
- tempstr cmd;
- cmd=Subst(_db.R,"src_func $ns LoadTuplesMaybe -gen | grep -Po -e 'root,\"\\K[^\"]*'");
- cstring slist(Trimmed(SysEval(cmd,FailokQ(true),1024*1024)));
-
cstring text;
Ins(&_db.R,text, "`$ns` takes the following tables on input:");
+ abt_md::zd_scanns_RemoveAll();
+ PopulateScanNs(*ns);
+
algo_lib::FTxttbl txttbl;
AddRow(txttbl);
AddCols(txttbl,"Ssimfile,Comment");
- ind_beg(algo::Line_curs,line,slist) {
- if (abt_md::FSsimfile *fssimfile=ind_ssimfile_Find(line)) {
- LinkToSsimfile(fssimfile->ssimfile,fssimfile->p_ctype->ctype);
- AddRow(txttbl);
- AddCol(txttbl,LinkToSsimfile(fssimfile->ssimfile,fssimfile->ssimfile));
- AddCol(txttbl,fssimfile->p_ctype->comment);
- }
+ ind_beg(_db_zd_scanns_curs,scanns,_db) {
+ ind_beg(abt_md::ns_zd_finput_curs,finput,scanns) {
+ if (abt_md::FSsimfile *fssimfile = FieldSsimfile(*finput.p_field->p_arg)) {
+ LinkToSsimfile(fssimfile->ssimfile,fssimfile->p_ctype->ctype);
+ AddRow(txttbl);
+ AddCol(txttbl,LinkToSsimfile(fssimfile->ssimfile,fssimfile->ssimfile));
+ AddCol(txttbl,fssimfile->p_ctype->comment);
+ }
+ }ind_end;
}ind_end;
- FTxttbl_Markdown(txttbl,text);
// omit section text if no inputs
if (algo_lib::c_txtrow_N(txttbl)>1) {
- section.text << Tabulated(text, "\t", "ll", 2);
+ FTxttbl_Markdown(txttbl,text);
+ section.text << text;
}
if (ns->nstype==dmmeta_Nstype_nstype_exe){
section.text<p_ns;
+ if (ns) {
+ section.text = "";// replace section text
+ ind_beg(ns_c_dispatch_curs,dispatch,*ns) {
+ Set(_db.R,"$comment",dispatch.comment.value);
+ Set(_db.R,"$dispatch",dispatch.dispatch);
+ Ins(&_db.R,section.text, "`$ns` Consumes the following messages via $dispatch ($comment)");
+ algo_lib::FTxttbl txttbl;
+ AddRow(txttbl);
+ AddCols(txttbl,"Message,Comment");
+ ind_beg(dispatch_c_dispatch_msg_curs,dispatch_msg,dispatch) {
+ AddRow(txttbl);
+ AddCol(txttbl,abt_md::LinkToCtype(*dispatch_msg.p_ctype));
+ AddCol(txttbl,dispatch_msg.p_ctype->comment);
+ }ind_end;
+ FTxttbl_Markdown(txttbl,section.text);
+ section.text << eol;
+ section.text << eol;
+ }ind_end;
+ }
+}
+
// -----------------------------------------------------------------------------
abt_md::FCtype *abt_md::GenerateFieldsTable(abt_md::FCtype &ctype, cstring &text_out, cstring &base_note){
@@ -177,7 +228,7 @@ abt_md::FCtype *abt_md::GenerateFieldsTable(abt_md::FCtype &ctype, cstring &text
// Extract generated info and combine into a table
void abt_md::mdsection_Imdb(abt_md::FFileSection §ion) {
- if (_db.c_readme->p_ns) {
+ if (_db.c_readmefile->p_ns) {
section.text = "";// replace section text
cstring text;
@@ -250,7 +301,7 @@ void abt_md::mdsection_Imdb(abt_md::FFileSection §ion) {
if (text!=""){
Ins(&abt_md::_db.R,section.text, "`$ns` generated code creates the tables below.");
Ins(&abt_md::_db.R,section.text, tempstr()<<"All allocations are done through global `$ns::_db` "
- <p_ns->ns<<".FDb")<<" structure");
+ <p_ns->ns<<".FDb")<<" structure");
FTxttbl_Markdown(txttbl,section.text);
section.text<p_ns) {
- abt_md::FCtype *ctype = ind_ctype_Find(tempstr()<<"command."<<_db.c_readme->p_ns->ns);
+ if (_db.c_readmefile->p_ns) {
+ abt_md::FCtype *ctype = ind_ctype_Find(tempstr()<<"command."<<_db.c_readmefile->p_ns->ns);
section.text = "";
if (ctype) {
ind_beg(ctype_c_field_curs,field,*ctype) {
@@ -276,10 +327,10 @@ void abt_md::mdsection_Options(abt_md::FFileSection §ion) {
void abt_md::mdsection_Ctypes(abt_md::FFileSection §ion) {
section.text = "";// replace section text
- if (abt_md::FNs *ns = _db.c_readme->p_ns) {
+ if (abt_md::FNs *ns = _db.c_readmefile->p_ns) {
cstring out;
ind_beg(ns_c_ctype_curs,ctype,*ns) {
- if (!FileQ(tempstr()<gitfile),name_Get(ctype))<<".md")) {
+ if (!FileQ(tempstr()<gitfile),name_Get(ctype))<<".md")) {
tempstr comment(ctype.comment);
if (comment == "" && ns_Get(ctype) == "report" && ind_ns_Find(name_Get(ctype))) {
comment << "Report line for "<< LinkToNs(name_Get(ctype));
@@ -301,11 +352,13 @@ void abt_md::mdsection_Ctypes(abt_md::FFileSection §ion) {
void abt_md::mdsection_Functions(abt_md::FFileSection §ion) {
section.text = "";// replace section text
- if (_db.c_readme->p_ns) {
+ if (_db.c_readmefile->p_ns) {
command::src_func_proc src_func;
- src_func.cmd.target.expr=_db.c_readme->p_ns->ns;
- src_func.cmd.proto=true;
+ src_func.cmd.func.expr = tempstr()<<_db.c_readmefile->p_ns->ns<<".%";
+ src_func.cmd.list=true;
src_func.cmd.showloc=false;
+ src_func.cmd.sortname=true;
+ src_func.cmd.showcomment=true;
src_func.cmd.showstatic=false;
algo_lib::FFildes read;
cstring comment;
@@ -334,19 +387,19 @@ void abt_md::mdsection_Functions(abt_md::FFileSection §ion) {
// For all other cases, leave title as-is
// Section contents are user-defined
void abt_md::mdsection_Title(abt_md::FFileSection §ion) {
- abt_md::FReadme *readme =_db.c_readme;
- if (readme->p_scriptfile) {
- section.title = tempstr()<< "## "<p_scriptfile->gitfile<<" - "<p_scriptfile->comment;
- } else if (readme->p_ssimfile) {
- section.title = tempstr()<< "## "<p_ssimfile->ssimfile<<" - "<p_ssimfile->p_ctype->comment;
- } else if (readme->p_ctype) {
- section.title = tempstr()<< "## "<p_ctype->ctype<<" - "<p_ctype->comment;
- } else if (readme->p_ns) {
- tempstr fname(StripDirName(readme->gitfile));
+ abt_md::FReadmefile *readmefile =_db.c_readmefile;
+ if (readmefile->p_scriptfile) {
+ section.title = tempstr()<< "## "<p_scriptfile->gitfile<<" - "<p_scriptfile->comment;
+ } else if (readmefile->p_ssimfile) {
+ section.title = tempstr()<< "## "<p_ssimfile->ssimfile<<" - "<p_ssimfile->p_ctype->comment;
+ } else if (readmefile->p_ctype) {
+ section.title = tempstr()<< "## "<p_ctype->ctype<<" - "<p_ctype->comment;
+ } else if (readmefile->p_ns) {
+ tempstr fname(StripDirName(readmefile->gitfile));
if (fname== "internals.md") {
- section.title = tempstr()<< "## "<p_ns->ns<<" - Internals";
+ section.title = tempstr()<< "## "<p_ns->ns<<" - Internals";
} else if (fname == "README.md") {
- section.title = tempstr()<< "## "<p_ns->ns<<" - "<p_ns->comment;
+ section.title = tempstr()<< "## "<p_ns->ns<<" - "<p_ns->comment;
} else {
// don't change -- could be some other chapter
}
@@ -358,7 +411,7 @@ void abt_md::mdsection_Title(abt_md::FFileSection §ion) {
// Update syntax string
// Invoke command with -h flag and substitute output into section body
void abt_md::mdsection_Syntax(abt_md::FFileSection §ion) {
- if (_db.c_readme->p_ns) {
+ if (_db.c_readmefile->p_ns && _db.cmdline.evalcmd) {
section.text="";
tempstr out = SysEval(Subst(_db.R,"$ns -h 2>&1"),FailokQ(true),1024*1024);
if (Trimmed(out)!="") {
@@ -377,11 +430,10 @@ void abt_md::mdsection_Syntax(abt_md::FFileSection §ion) {
// but can include those links outside of ToC
// README.md must not include a link to internals.md on the same level (this link has to come
// from above) to avoid contaminating ToC tree with unneeded details
-// for more information see spnx
void abt_md::mdsection_Toc(abt_md::FFileSection §ion) {
section.text = "";
- abt_md::FReadme *readme = _db.c_readme;
- tempstr dirname(GetDirName(readme->gitfile));
+ abt_md::FReadmefile *readmefile = _db.c_readmefile;
+ tempstr dirname(GetDirName(readmefile->gitfile));
// the top-level README.md cannot be a soft link, or it won't be displayed
// so if we detect that the directory is top-level, we begin our search under txt/
if (dirname =="") {
@@ -410,24 +462,23 @@ void abt_md::mdsection_Toc(abt_md::FFileSection §ion) {
}
// create links to subdirectories
- bool mainfile = StripDirName(readme->gitfile)=="README.md";
+ bool mainfile = StripDirName(readmefile->gitfile)=="README.md";
// Create links to other files in this directory
cstring text;
abt_md::FDirscan dirscan;
- PopulateDirent(dirscan, tempstr()<gitfile)<<"*.md");
+ PopulateDirent(dirscan, tempstr()<gitfile)<<"*.md");
ind_beg(abt_md::FDirscan_bh_dirent_curs,ent,dirscan) {
// - don't link to this file
// - don't link to empty file
- if (ent.pathname != _db.c_readme->gitfile && StripExt(ent.filename) != "") {
+ if (ent.pathname != _db.c_readmefile->gitfile && StripExt(ent.filename) != "") {
text << FileIcon() << LinkToMd(ent.pathname) << "]
" << eol;
}
}ind_end;
// non-README must not include links to other files in the same directory into TOC.
// README.md must not include a link to internals.md on the same level (this link has to come
// from above) to avoid contaminating ToC tree with unneeded details
- // for more information see spnx
- bool has_internals = FileQ(DirFileJoin(GetDirName(_db.c_readme->gitfile),"internals.md"));
+ bool has_internals = FileQ(DirFileJoin(GetDirName(_db.c_readmefile->gitfile),"internals.md"));
if (!mainfile || has_internals) {
section.text << text;
text = "";
@@ -477,9 +528,9 @@ void abt_md::mdsection_Chapters(abt_md::FFileSection §ion) {
void abt_md::mdsection_Sources(abt_md::FFileSection §ion) {
section.text = "";// replace section text
- abt_md::FReadme *readme = _db.c_readme;
- if (readme->p_ns) {
- abt_md::FNs *ns = readme->p_ns;
+ abt_md::FReadmefile *readmefile = _db.c_readmefile;
+ if (readmefile->p_ns) {
+ abt_md::FNs *ns = readmefile->p_ns;
section.text << "The source code license is "<license<gitfile, "txt/script/")) {
+ } else if (StartsWithQ(readmefile->gitfile, "txt/script/")) {
// see if this file matches a scriptfile
- tempstr fname = tempstr() << "bin/"<gitfile));
+ tempstr fname = tempstr() << "bin/"<gitfile));
if (abt_md::FScriptfile *scriptfile = ind_scriptfile_Find(fname)) {
section.text << "The source code license is "<license<p_ns && readme->p_ns->c_target && c_targdep_N(*readme->p_ns->c_target)) {
- abt_md::FTarget *target=readme->p_ns->c_target;
+ abt_md::FReadmefile *readmefile = _db.c_readmefile;
+ if (readmefile->p_ns && readmefile->p_ns->c_target && c_targdep_N(*readmefile->p_ns->c_target)) {
+ abt_md::FTarget *target=readmefile->p_ns->c_target;
section.text << "The build target depends on the following libraries"<p_ns) {
+ if (_db.c_readmefile->p_ns) {
section.text = "";// replace section text
- if (c_comptest_N(*_db.c_readme->p_ns)) {
+ if (c_comptest_N(*_db.c_readmefile->p_ns)) {
Ins(&_db.R,section.text, "The following component tests are defined for `$ns`.");
Ins(&_db.R,section.text, "These can be executed with `atf_comp -v`");
algo_lib::FTxttbl txttbl;
AddRow(txttbl);
AddCols(txttbl,"Comptest,Comment");
- ind_beg(ns_c_comptest_curs,comptest,*_db.c_readme->p_ns) {
+ ind_beg(ns_c_comptest_curs,comptest,*_db.c_readmefile->p_ns) {
AddRow(txttbl);
tempstr fname = tempstr() << "test/atf_comp/" << comptest.comptest;
AddCol(txttbl,LinkToFileAbs(comptest.comptest,fname));
@@ -577,7 +628,7 @@ void abt_md::mdsection_Reftypes(abt_md::FFileSection §ion) {
void abt_md::mdsection_Subsets(abt_md::FFileSection §ion) {
section.text = "";// replace section text
cstring out;
- if (abt_md::FSsimfile *ssimfile = _db.c_readme->p_ssimfile) {
+ if (abt_md::FSsimfile *ssimfile = _db.c_readmefile->p_ssimfile) {
ind_beg(ctype_c_field_arg_curs,field,*ssimfile->p_ctype) if (field.ispkey) {
abt_md::FCtype &childtype=*field.p_ctype;
if (childtype.c_ssimfile) {
@@ -586,7 +637,7 @@ void abt_md::mdsection_Subsets(abt_md::FFileSection §ion) {
}ind_end;
}
if (out != "") {
- section.text << "These ssimfiles are subsets of "<<_db.c_readme->p_ssimfile->ssimfile<p_ssimfile->ssimfile<p_ssimfile) {
+ if (abt_md::FSsimfile *ssimfile = _db.c_readmefile->p_ssimfile) {
ind_beg(ctype_c_field_arg_curs,field,*ssimfile->p_ctype) if (!field.ispkey) {
abt_md::FCtype &childtype=*field.p_ctype;
if (childtype.c_ssimfile) {
@@ -612,7 +663,7 @@ void abt_md::mdsection_Related(abt_md::FFileSection §ion) {
}ind_end;
}
if (out != "") {
- section.text << "These ssimfiles reference "<<_db.c_readme->p_ssimfile->ssimfile<p_ssimfile->ssimfile<p_ssimfile) {
+ if (abt_md::FSsimfile *ssimfile = _db.c_readmefile->p_ssimfile) {
ind_beg(ctype_c_field_arg_curs,field,*ssimfile->p_ctype) {
abt_md::FCtype &childtype=*field.p_ctype;
if (ns_Get(childtype) == "command") {
@@ -646,7 +697,7 @@ void abt_md::mdsection_CmdlineUses(abt_md::FFileSection §ion) {
void abt_md::mdsection_ImdbUses(abt_md::FFileSection §ion) {
section.text = "";// replace section text
cstring out;
- if (abt_md::FSsimfile *ssimfile = _db.c_readme->p_ssimfile) {
+ if (abt_md::FSsimfile *ssimfile = _db.c_readmefile->p_ssimfile) {
ind_beg(ctype_c_field_arg_curs,field,*ssimfile->p_ctype) if (field.reftype == dmmeta_Reftype_reftype_Base) {
abt_md::FCtype &childtype=*field.p_ctype;
if (childtype.p_ns->nstype == dmmeta_Nstype_nstype_lib || childtype.p_ns->nstype == dmmeta_Nstype_nstype_exe) {
@@ -665,7 +716,7 @@ void abt_md::mdsection_ImdbUses(abt_md::FFileSection §ion) {
void abt_md::mdsection_Constants(abt_md::FFileSection §ion) {
// TODO: - add to libs and protocols...
section.text = "";
- if (abt_md::FSsimfile *ssimfile = _db.c_readme->p_ssimfile) {
+ if (abt_md::FSsimfile *ssimfile = _db.c_readmefile->p_ssimfile) {
algo_lib::FTxttbl txttbl;
AddRow(txttbl);
AddCols(txttbl,"Field,Fconst,Value,Comment");
diff --git a/cpp/acr/check.cpp b/cpp/acr/check.cpp
index 379645ec..15a83bbd 100644
--- a/cpp/acr/check.cpp
+++ b/cpp/acr/check.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2016-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -64,7 +64,7 @@ static void CheckArgs_Rec(acr::FRec &rec, acr::FCtype &ctype, acr::FCheck &check
static void CheckArgs(acr::FCheck &check) {
ind_beg(acr::_db_zd_sel_ctype_curs, ctype, acr::_db) {
- ind_beg(acr::ctype_zd_ctype_selrec_curs, rec, ctype) {
+ ind_beg(acr::ctype_zd_selrec_curs, rec, ctype) {
CheckArgs_Rec(rec,ctype,check);
}ind_end;
}ind_end;
@@ -85,7 +85,7 @@ static void SuggestAlternatives(acr::FCtype &ctype, acr::FField &field, acr::FCh
help << "Valid values ";
algo::ListSep ls(", ");
int idx = 0;
- ind_beg(acr::ctype_zd_ctype_rec_curs, rec, *field.p_arg) {
+ ind_beg(acr::ctype_zd_rec_curs, rec, *field.p_arg) {
if (idx++ > 100) {
help << ", ...";
break;
@@ -101,7 +101,7 @@ static void SuggestAlternatives(acr::FCtype &ctype, acr::FField &field, acr::FCh
static void CheckXref_Field(acr::FCtype &ctype, acr::FField &field, acr::FCheck &check) {
LoadRecords(*field.p_arg);
acr::c_bad_rec_RemoveAll(check);
- ind_beg(acr::ctype_zd_ctype_selrec_curs, rec, ctype) {// loop through all records for this ctype
+ ind_beg(acr::ctype_zd_selrec_curs, rec, ctype) {// loop through all records for this ctype
tempstr attr(EvalAttr(rec.tuple, field));// find attribute value
if (!acr::ind_ctype_rec_Find(*field.p_arg,attr)) {// check index for pkey
c_bad_rec_Insert(check, rec);
@@ -140,7 +140,7 @@ static void CheckFunique() {
ind_beg(acr::_db_zd_sel_ctype_curs, ctype, acr::_db) {
ind_beg(acr::ctype_c_field_curs, field, ctype) if (field.unique) {
// compute key: it is field + field value
- ind_beg(acr::ctype_zd_ctype_selrec_curs, rec, ctype) {// loop through all records for this ctype
+ ind_beg(acr::ctype_zd_selrec_curs, rec, ctype) {// loop through all records for this ctype
tempstr value(EvalAttr(rec.tuple, field));// find attribute value
tempstr key = tempstr()<n_insert == 0 && acr::_db.cmdline.trunc) {
- ind_beg(acr::ctype_zd_ctype_rec_curs,rec,*ctype) {
+ ind_beg(acr::ctype_zd_rec_curs,rec,*ctype) {
rec.del=true;
}ind_end;
}
@@ -150,11 +150,14 @@ acr::FRec *acr::CreateRec(acr::FFile &file, acr::FCtype *ctype, algo::Tuple &tup
float rowid = ret ? ret->sortkey.rowid : -1;
if (read_mode == acr_ReadMode_acr_select) {
if (ret) {
+ // explicit select
Rec_Select(*ret);
}
} else if (read_mode == acr_ReadMode_acr_delete) {
if (ret) {
ret->del = true;
+ // select record so that cascade delete picks it up
+ Rec_Select(*ret);
} else {
_db.report.n_ignore++;
}
diff --git a/cpp/acr/err.cpp b/cpp/acr/err.cpp
index 2e575c22..c4462e39 100644
--- a/cpp/acr/err.cpp
+++ b/cpp/acr/err.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
//
diff --git a/cpp/acr/eval.cpp b/cpp/acr/eval.cpp
index 36a2bcd3..c8fa17a6 100644
--- a/cpp/acr/eval.cpp
+++ b/cpp/acr/eval.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/cpp/acr/git.cpp b/cpp/acr/git.cpp
index 400e2422..612cf39e 100644
--- a/cpp/acr/git.cpp
+++ b/cpp/acr/git.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2024 AlgoRND
+// Copyright (C) 2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -26,7 +26,7 @@ void acr::Main_GitTriggers() {
acr::FSsimfile *gitfile = ind_ssimfile_Find("dev.gitfile");
algo::cstring script;
if (gitfile) {
- ind_beg(acr::ctype_zd_ctype_selrec_curs,selrec,*gitfile->p_ctype) {
+ ind_beg(acr::ctype_zd_selrec_curs,selrec,*gitfile->p_ctype) {
if (selrec.del) {
script << "git rm --force "<key) * 2;
+ bool isnew=rec.isnew;
// indent
char_PrintNTimes(' ', print.out, indent);
+ if (!rec.del) {
+ algo::strptr oldhead = rec.oldhead ? algo::strptr(*rec.oldhead) : algo::strptr(rec.tuple.head.value);
+ algo::strptr oldpkey = rec.oldpkey ? algo::strptr(*rec.oldpkey) : algo::strptr(rec.pkey);
+ // when the head or primary key of a record are changed,
+ // we must print a "delete" command for the old record, since the
+ // "update" no longer properly describes the modification
+ if (attrs_Find(rec.tuple,0) && (oldhead != rec.tuple.head.value || oldpkey != rec.pkey)) {
+ print.out << "acr.delete";
+ PrintAttrSpace(print.out, "", oldhead);
+ PrintAttrSpace(print.out, attrs_Find(rec.tuple,0)->name, oldpkey);
+ print.out << eol;
+ isnew=true; // re-print as new
+ }
+ }
if (print.showstatus) {
if (rec.del) {
print.out << "acr.delete ";
- } else if (rec.isnew) {
+ } else if (isnew) {// use locally computed value
print.out << "acr.insert ";
} else if (rec.mod) {
print.out << "acr.update ";
diff --git a/cpp/acr/query.cpp b/cpp/acr/query.cpp
index 8373cb40..070fb51d 100644
--- a/cpp/acr/query.cpp
+++ b/cpp/acr/query.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
//
@@ -192,6 +192,9 @@ static bool VisitField(acr::FQuery& query, acr::FRec& rec, acr::FField &field, a
} break;
case acr_Queryop_value_rename_typetag: {
+ if (!rec.oldhead) {
+ oldhead_Access(rec) = rec.tuple.head.value;// save old head, but only once
+ }
rec.tuple.head.value = query.new_val;
MarkModified(query,rec);
} break;
@@ -269,7 +272,7 @@ void acr::RunQuery(acr::FQuery &query) {
}
} else {
// compute list of potential ssimfiles that contain matches
- if (!query.ssimfile.literal) {
+ if (!literal_Get(query.ssimfile.flags)) {
ind_beg(acr::_db_ssimfile_curs, ssimfile,acr::_db) {
query.n_regx_match++;
if (Regx_Match(query.ssimfile, ssimfile.ssimfile)) {
@@ -285,6 +288,11 @@ void acr::RunQuery(acr::FQuery &query) {
// load ssimfiles (if necessary)
ind_beg(acr::query_c_ctype_curs, ctype, query) {
LoadRecords(ctype);
+ // If no records were loaded, consider the ctype "selected"
+ // so that "sample tuple" can be shown
+ if (ind_ctype_rec_N(ctype)==0) {
+ acr::zd_sel_ctype_Insert(ctype);
+ }
}ind_end;
// Visit all selected ctypes in QUERY, scan all records
// of each ctype and match QUERY against each record.
@@ -295,7 +303,7 @@ void acr::RunQuery(acr::FQuery &query) {
query.n_visit_ctype++;
// match on pkey if the query field is omitted
bool is_pkey = !ch_N(query.query.name.expr)
- || (query.query.name.literal && query.query.name.expr == name_Get(*c_field_Find(ctype, 0)));
+ || (literal_Get(query.query.name.flags) && query.query.name.expr == name_Get(*c_field_Find(ctype, 0)));
// determine set of fields to scan
// if query is for pkey, we already have that indexed.
@@ -313,13 +321,13 @@ void acr::RunQuery(acr::FQuery &query) {
// determine set of records to scan
c_rec_RemoveAll(query);
- if (is_pkey && query.query.value.literal) {
+ if (is_pkey && literal_Get(query.query.value.flags)) {
acr::FRec *rec = acr::ind_ctype_rec_Find(ctype, query.query.value.expr);
if (rec) {
c_rec_Insert(query, *rec);
}
} else {
- ind_beg(acr::ctype_zd_ctype_rec_curs, rec, ctype) {
+ ind_beg(acr::ctype_zd_rec_curs, rec, ctype) {
c_rec_Insert(query, rec);
}ind_end;
}
diff --git a/cpp/acr/select.cpp b/cpp/acr/select.cpp
index 936e620a..edb55bbc 100644
--- a/cpp/acr/select.cpp
+++ b/cpp/acr/select.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
//
@@ -31,9 +31,9 @@
// If the record was the last selected record for its ctype,
// remove its ctype from the selected list
void acr::Rec_Deselect(acr::FRec& rec) {
- acr::zd_ctype_selrec_Remove(*rec.p_ctype, rec);
+ acr::zd_selrec_Remove(*rec.p_ctype, rec);
acr::zd_all_selrec_Remove(rec);
- if (zd_ctype_selrec_EmptyQ(*rec.p_ctype)) {
+ if (zd_selrec_EmptyQ(*rec.p_ctype)) {
acr::zd_sel_ctype_Remove(*rec.p_ctype);
}
}
@@ -47,7 +47,7 @@ void acr::Rec_Deselect(acr::FRec& rec) {
void acr::Rec_DeselectAll() {
acr::zd_all_selrec_RemoveAll();
while(acr::FCtype *ctype=acr::zd_sel_ctype_First()) {
- acr::zd_ctype_selrec_RemoveAll(*ctype);
+ acr::zd_selrec_RemoveAll(*ctype);
acr::zd_sel_ctype_RemoveFirst();
}
}
@@ -89,7 +89,7 @@ bool acr::Rec_Select(acr::FRec& rec) {
if (add) {
rec.seldist = 0;
acr::zd_all_selrec_Insert(rec);
- acr::zd_ctype_selrec_Insert(*rec.p_ctype,rec);
+ acr::zd_selrec_Insert(*rec.p_ctype,rec);
acr::zd_sel_ctype_Insert(*rec.p_ctype);
}
return add;
diff --git a/cpp/acr/verb.cpp b/cpp/acr/verb.cpp
index 0c1aa5cb..ac7eaac1 100644
--- a/cpp/acr/verb.cpp
+++ b/cpp/acr/verb.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -260,7 +260,7 @@ int acr::Main_SelectDown(bool unused) {
// add records which reference one of selected records
ind_beg(acr::_db_c_ctype_front_curs, child, _db) {
LoadRecords(child);
- ind_beg(acr::ctype_zd_ctype_rec_curs, rec, child) {
+ ind_beg(acr::ctype_zd_rec_curs, rec, child) {
ind_beg(acr::ctype_c_field_curs, field, child) if (field.p_arg->c_ssimfile && LeftCheck(child,field)) {
tempstr val(EvalAttr(rec.tuple, field));
acr::FRec *parrec = acr::ind_ctype_rec_Find(*field.p_arg, val);
@@ -275,7 +275,7 @@ int acr::Main_SelectDown(bool unused) {
// work.
if (good) {
zd_all_selrec_Remove(*parrec);
- zd_ctype_selrec_Remove(*parrec->p_ctype, *parrec);
+ zd_selrec_Remove(*parrec->p_ctype, *parrec);
}
} else {
good = good && Rec_Select(rec);
@@ -394,7 +394,7 @@ void acr::CascadeDelete() {
// scan all selected records since the last one
// collect a list of child tables to scan
for (; rec; rec=zd_all_selrec_Next(*rec)) {
- if (rec->del) {
+ if (rec->del && !rec->isnew) {
if (_db.cmdline.x) {
DelChildRecords(*rec);
}
@@ -410,7 +410,7 @@ void acr::CascadeDelete() {
// makr any references to a deleted record as deleted
ind_beg(acr::_db_c_ctype_front_curs, child, _db) {
LoadRecords(child);
- ind_beg(acr::ctype_zd_ctype_rec_curs, childrec, child) {
+ ind_beg(acr::ctype_zd_rec_curs, childrec, child) {
ind_beg(acr::ctype_c_field_curs, field, child) if (field.p_arg->c_ssimfile) {
acr::FRec *parrec = acr::ind_ctype_rec_Find(*field.p_arg, EvalAttr(childrec.tuple, field));
if (parrec && parrec->del) {
diff --git a/cpp/acr/write.cpp b/cpp/acr/write.cpp
index fe1824e5..f1529cb2 100644
--- a/cpp/acr/write.cpp
+++ b/cpp/acr/write.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/cpp/acr_compl/main.cpp b/cpp/acr_compl/main.cpp
index afb599c8..9b5d01dc 100644
--- a/cpp/acr_compl/main.cpp
+++ b/cpp/acr_compl/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
//
@@ -54,7 +54,7 @@ tempstr acr_compl::GetCmdArgType(acr_compl::FField& field) {
ret = "flag";
} else if (field.reftype == dmmeta_Reftype_reftype_Pkey) {
ret = "pkey";
- } if (field.reftype == dmmeta_Reftype_reftype_RegxSql) {
+ } else if (field.reftype == dmmeta_Reftype_reftype_RegxSql) {
ret = "regx";
} else {
if (!argvtype && c_field_N(*field.p_arg) == 1) {
@@ -164,7 +164,7 @@ bool acr_compl::UniqueCompletionQ() {
}
iter++;
}ind_end;
- dbglog("iter="< ch_N(_db.cmdline.line)) {
- dbglog("Bad completion point - exceeds line length");
+ prcat(debug,"Bad completion point - exceeds line length");
return;
}
@@ -351,7 +351,7 @@ void acr_compl::Main_Line() {
_db.line = ch_FirstN(_db.cmdline.line,_db.point);
// split to argv
if (!Main_SplitLineToArgv()) {
- dbglog("Unfinished io redirect");
+ prcat(debug,"Unfinished io redirect");
return;
};
@@ -362,7 +362,7 @@ void acr_compl::Main_Line() {
// can't do anything without command
if (word_EmptyQ()) {
- dbglog("Empty line"); // should never happen (command line test only)
+ prcat(debug,"Empty line"); // should never happen (command line test only)
return;
}
strptr cmd = StripDirName(word_qFind(0));
@@ -370,7 +370,7 @@ void acr_compl::Main_Line() {
FFcmdline *fcmdline = ns ? ns->c_fcmdline : NULL;
FCtype *ctype = fcmdline ? fcmdline->p_field->p_arg : NULL;
if (!ctype) {
- dbglog("Unknown command"); // may happen if outdated completion exists on bash
+ prcat(debug,"Unknown command"); // may happen if outdated completion exists on bash
return;
}
@@ -378,12 +378,12 @@ void acr_compl::Main_Line() {
ind_beg(ctype_c_field_curs,field,*ctype) {
zd_cmd_field_Insert(field);
ind_cmd_field_name_InsertMaybe(field);
- //dbglog(field);
+ //prcat(debug,field);
}ind_end;
ind_beg(ctype_c_field_curs,field,*fcmdline->p_basecmdline->p_arg) {
zd_cmd_field_Insert(field);
ind_cmd_field_name_InsertMaybe(field);
- //dbglog(field);
+ //prcat(debug,field);
}ind_end;
// parse command line
@@ -413,7 +413,7 @@ void acr_compl::Main_Line() {
} else if (word == "--") { // end of named options
_db.anon = true;
if (is_last) { // do not complete last
- dbglog("Double dash is last");
+ prcat(debug,"Double dash is last");
return;
}
} else {
@@ -426,7 +426,7 @@ void acr_compl::Main_Line() {
tempstr field_key = dmmeta::Field_Concat_ctype_name(ctype->ctype,_db.name);
FField *field = ind_cmd_field_name_Find(_db.name);
if (!field) {
- dbglog("Unknown option: "<<_db.name);
+ prcat(debug,"Unknown option: "<<_db.name);
return;
}
_db.need_value = !_db.exact && CmdArgValueRequiredQ(*field); // check for extra arg, only if no colon
@@ -441,14 +441,14 @@ void acr_compl::Main_Line() {
_db.exact = false;
}
}
- dbglog("atf_compl.parse_word"
- << Keyval("word",word)
- << Keyval("name",_db.name)
- << Keyval("value",_db.value)
- << Keyval("need_value",_db.need_value)
- << Keyval("anon_index",_db.anon_index)
- << Keyval("exact",_db.exact)
- << Keyval("anon",_db.anon));
+ prcat(debug,"atf_compl.parse_word"
+ << Keyval("word",word)
+ << Keyval("name",_db.name)
+ << Keyval("value",_db.value)
+ << Keyval("need_value",_db.need_value)
+ << Keyval("anon_index",_db.anon_index)
+ << Keyval("exact",_db.exact)
+ << Keyval("anon",_db.anon));
}ind_end;
// mark seen anons below anon_index
@@ -467,8 +467,8 @@ void acr_compl::Main_Line() {
if (!ch_N(_db.name) && !_db.anon) {
ind_beg(_db_zd_cmd_field_curs,field,_db) {
if (EligibleQ(field) && CmdArgRequiredQ(field)) {
- dbglog("atf_compl.first_unseen_mandatory"
- << Keyval("name",name_Get(field)));
+ prcat(debug,"atf_compl.first_unseen_mandatory"
+ << Keyval("name",name_Get(field)));
AddFieldToCompletion(field,acr_compl_Badness_first);
break;
}
@@ -485,10 +485,10 @@ void acr_compl::Main_Line() {
? (field.reftype == dmmeta_Reftype_reftype_Tary && cnt <= _db.anon_index)
|| cnt == _db.anon_index
: field.reftype != dmmeta_Reftype_reftype_Tary && EligibleQ(field);
- dbglog("atf_compl.anon"
- <value)
- <nospace));
+ prcat(debug,"acr_compl.unique_completion"
+ <value)
+ <nospace));
cur_field = bh_completion_First()->field;
if (_db.exact || ch_N(_db.value)) {
completion_RemoveAll();
@@ -528,8 +528,8 @@ void acr_compl::Main_Line() {
} else {
completion_RemoveAll();
compl_prefix << '-' << name_Get(*cur_field) << ':';
- dbglog("acr_compl.value_completion"
- <c_field_n > 0) {
+ auto msgtype_ctype_w_base = dmmeta::Field_Concat_ctype_name(msgtype.ctype, "base");
+ // If the first field of this msgtype is Base and the arg is the target subset
+ if (msgtype_ctype_w_base == base_type->c_field_elems[0]->field
+ && target_subset == base_type->c_field_elems[0]->arg) {
+ algo::StringIter iter(msgtype.type.value);
+ u32 msgtype_value;
+ if (algo::TryParseU32(iter, msgtype_value)
+ && msgtype_value > next_msg_type_value) {
+ next_msg_type_value = msgtype_value;
+ }
+ }
+ }
+ }ind_end;
+ tempstr ret;
+ ret << next_msg_type_value+1;
+ return ret;
+}
+
// -----------------------------------------------------------------------------
// Create a new ctype
@@ -155,16 +181,21 @@ void acr_ed::edaction_Create_Ctype() {
}
// if new ctype is a subset of one other relational ctype, use that type's name.
- if (ch_N(acr_ed::_db.cmdline.subset2) == 0 && relational) {
+ if (ch_N(acr_ed::_db.cmdline.subset2) == 0) {
acr_ed::FCtype &subset = acr_ed::ind_ctype_FindX(acr_ed::_db.cmdline.subset);
// if creating a subset of a relational type, borrow the name of the first field
- if (c_field_N(subset) > 0 && subset.c_ssimfile) {
- pkey_name = name_Get(*c_field_Find(subset,0));
- }
- if (subset.p_ns->nstype == dmmeta_Nstype_nstype_ssimdb) {
- pkey.reftype = dmmeta_Reftype_reftype_Pkey;
- } else {
- pkey.reftype = dmmeta_Reftype_reftype_Val;
+ if (relational) {
+ if (c_field_N(subset) > 0 && subset.c_ssimfile) {
+ pkey_name = name_Get(*c_field_Find(subset,0));
+ }
+ if (subset.p_ns->nstype == dmmeta_Nstype_nstype_ssimdb) {
+ pkey.reftype = dmmeta_Reftype_reftype_Pkey;
+ } else {
+ pkey.reftype = dmmeta_Reftype_reftype_Val;
+ }
+ } else if (subset.c_typefld && algo::ch_N(subset.c_typefld->field)) {
+ // If subset has typefld entry this is proto Msg type thus using Base reftype
+ pkey.reftype = dmmeta_Reftype_reftype_Base;
}
}
@@ -195,7 +226,10 @@ void acr_ed::edaction_Create_Ctype() {
if (base_type->c_typefld) {
dmmeta::Msgtype msgtype;
msgtype.ctype = ctype.ctype;
- algo::CppExpr_ReadStrptrMaybe(msgtype.type,acr_ed::_db.cmdline.msgtype);
+ cstring msgtype_str_arg = acr_ed::_db.cmdline.msgtype.ch_n
+ ? cstring(acr_ed::_db.cmdline.msgtype)
+ : getNextMsgTypeValue(acr_ed::_db.cmdline.subset);
+ algo::CppExpr_ReadStrptrMaybe(msgtype.type,msgtype_str_arg);
acr_ed::_db.out_ssim << msgtype << eol;
}
if (base_type->c_cpptype) {
diff --git a/cpp/acr_ed/field.cpp b/cpp/acr_ed/field.cpp
index 0da66dba..4c70f437 100644
--- a/cpp/acr_ed/field.cpp
+++ b/cpp/acr_ed/field.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
@@ -203,6 +203,7 @@ static void PrintNewField(dmmeta::Field &field) {
acr_ed::_db.out_ssim << " acr.rowid:"< $srcfile << EOF");
- if (cpp_or_h) {
- bool mainheader = StripExt(StripDirName(acr_ed::_db.cmdline.srcfile)) == acr_ed::_db.cmdline.target;
- InsertSrcfileInclude(R, mainheader);
- }
- if (readme) {
- Ins(&R, acr_ed::_db.script, "## $srcfile");
+ // create file, insert some content
+ // but only if file doesn't exist
+ if (!FileQ(_db.cmdline.srcfile)) {
+ acr_ed::_db.script<<"cat > "<0 && ns_Get(ssimfile) == name_Get(*c_field_Find(*ssimfile.p_ctype,0))) {
+ if (c_field_N(*ssimfile.p_ctype)>0 && name_Get(ssimfile) == name_Get(*c_field_Find(*ssimfile.p_ctype,0))) {
command::acr acr;
acr.query = tempstr() << "dmmeta.field:"<> cpp/atf/unit/$ns.cpp << EOF");
+ Ins(&R, acr_ed::_db.script, "cat >> cpp/atf_unit/$ns.cpp << EOF");
Ins(&R, acr_ed::_db.script, "// --------------------------------------------------------------------------------");
Ins(&R, acr_ed::_db.script, "");
Ins(&R, acr_ed::_db.script, "void atf_unit::unittest_$ns_$Name() {");
@@ -54,7 +54,7 @@ void acr_ed::edaction_Create_Unittest() {
Ins(&R, acr_ed::_db.script, "}");
Ins(&R, acr_ed::_db.script, "EOF");
Ins(&R, acr_ed::_db.script, "amc");
- ScriptEditFile(R,"cpp/atf/unit/$ns.cpp");
+ ScriptEditFile(R,"cpp/atf_unit/$ns.cpp");
Ins(&R, acr_ed::_db.script, "$prefixabt -install atf_unit && atf_unit $ns.$Name");
}
diff --git a/cpp/acr_in/acr_in.cpp b/cpp/acr_in/acr_in.cpp
index 4c2b1061..9c5d2a24 100644
--- a/cpp/acr_in/acr_in.cpp
+++ b/cpp/acr_in/acr_in.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -64,7 +64,7 @@ static void Main_Ns() {
}ind_end;
// Extend namespace selection to include all dependent targets
- for (acr_in::FTarget *target = acr_in::zd_targ_visit_First(); target; target=target->zd_targ_visit_next) {
+ for (acr_in::FTarget *target = acr_in::zd_targ_visit_First(); target; target=zd_targ_visit_Next(*target)) {
ind_beg(acr_in::target_c_targdep_curs,targdep,*target) {
acr_in::FTarget *parent = targdep.p_parent;
if ((parent->p_ns->nstype == dmmeta_Nstype_nstype_exe) || (parent->p_ns->nstype == dmmeta_Nstype_nstype_lib)) {
diff --git a/cpp/acr_in/data.cpp b/cpp/acr_in/data.cpp
index dde309de..6b5bcb79 100644
--- a/cpp/acr_in/data.cpp
+++ b/cpp/acr_in/data.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -56,7 +56,7 @@ static void Main_Related() {
}ind_end;
// Build list of related ctypes (all ctypes derived from initial selection)
- for (acr_in::FCtype *ctype = acr_in::zd_related_First(); ctype; ctype = ctype->zd_related_next) {
+ for (acr_in::FCtype *ctype = acr_in::zd_related_First(); ctype; ctype = zd_related_Next(*ctype)) {
ind_beg(acr_in::ctype_c_ctype_curs, child, *ctype) {
acr_in::zd_related_Insert(child);
child.select = true;
@@ -65,7 +65,7 @@ static void Main_Related() {
}
// select any children of related records
- for (acr_in::FTuple *tuple = acr_in::zd_select_First(); tuple; tuple = tuple->zd_select_next) {
+ for (acr_in::FTuple *tuple = acr_in::zd_select_First(); tuple; tuple = zd_select_Next(*tuple)) {
ind_beg(acr_in::tuple_c_child_curs, child, *tuple) {
child.p_ctype->select = true;
acr_in::zd_select_Insert(child);
diff --git a/cpp/acr_my/acr_my.cpp b/cpp/acr_my/acr_my.cpp
index 7372dce6..e5aa8ad3 100644
--- a/cpp/acr_my/acr_my.cpp
+++ b/cpp/acr_my/acr_my.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/cpp/amc/alias.cpp b/cpp/amc/alias.cpp
index ffb7df45..b8214986 100644
--- a/cpp/amc/alias.cpp
+++ b/cpp/amc/alias.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
diff --git a/cpp/amc/amc_gc.cpp b/cpp/amc/amc_gc.cpp
index b9b05bf6..7827cdd1 100644
--- a/cpp/amc/amc_gc.cpp
+++ b/cpp/amc/amc_gc.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
//
diff --git a/cpp/amc/amc_vis.cpp b/cpp/amc/amc_vis.cpp
index 1445012f..904f1f98 100644
--- a/cpp/amc/amc_vis.cpp
+++ b/cpp/amc/amc_vis.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -27,13 +27,31 @@
#include "include/algo.h"
#include "include/gen/amc_vis_gen.h"
#include "include/gen/amc_vis_gen.inl.h"
-
+#include
+#include
+
+FILE *_pager=NULL;
+static void StartPager() {
+ if (!_pager) {
+ _pager = popen("less -n -S -R -P '%lb lines, %pb%% done.'", "w");
+ if (_pager) {
+ dup2(fileno(_pager),STDOUT_FILENO);
+ }
+ }
+}
+static void StopPager() {
+ if (_pager) {
+ close(STDOUT_FILENO);// without this, pager hangs
+ pclose(_pager);
+ _pager=NULL;
+ }
+}
// -----------------------------------------------------------------------------
// schedule a before b
-static void MakeABeforeB(amc_vis::Link &a, amc_vis::Link &b) {
- amc_vis::Linkdep &linkdep = amc_vis::linkdep_Alloc();
+static void MakeABeforeB(amc_vis::FLink &a, amc_vis::FLink &b) {
+ amc_vis::FLinkdep &linkdep = amc_vis::linkdep_Alloc();
linkdep.p_link_from = &a;
linkdep.p_link_to = &b;
vrfy(amc_vis::linkdep_XrefMaybe(linkdep), algo_lib::_db.errtext);
@@ -41,10 +59,14 @@ static void MakeABeforeB(amc_vis::Link &a, amc_vis::Link &b) {
// -----------------------------------------------------------------------------
+// Each access path gets 1 row -- the function setes FLink.outrow
+// for all existing links
static void Main_RowLayout() {
// count # incoming links for each link
ind_beg(amc_vis::_db_link_curs, link, amc_vis::_db) {
- link.linkkey.colweight = zd_link_out_N(*link.p_node2) + zd_link_in_N(*link.p_node2);
+ // the more incoming links a column has, the sooner we want to schedule its rows
+ // to clear it out of the way
+ link.linkkey.colweight = -(zd_link_out_N(*link.p_node2) + zd_link_in_N(*link.p_node2));
ind_beg(amc_vis::link_zd_linkdep_out_curs, linkdep, link) {
linkdep.p_link_to->linkkey.n_link_in++;
}ind_end;
@@ -54,18 +76,20 @@ static void Main_RowLayout() {
amc_vis::bh_link_Reheap(link);
}ind_end;
- // topologically sort fields! create final sorted list of links -- linklist
- while (amc_vis::Link *link = amc_vis::bh_link_RemoveFirst()) {
+ // topologically sort fields! create final sorted list of links
+ int nextrow = 0;
+ while (amc_vis::FLink *link = amc_vis::bh_link_RemoveFirst()) {
+ link->outrow = nextrow++;
amc_vis::c_linklist_Insert(*link);
// schedule rest sooner
if (link == link->p_node2->c_top) {
- link->p_node2->c_bottom->linkkey.topbot -= 1;
amc_vis::bh_link_Reheap(*link->p_node2->c_bottom);
- }
- // Schedule all links that lead to the same node sooner
- if (link == link->p_node2->c_top) {
- ind_beg(amc_vis::node_zd_link_in_curs, prior, *link->p_node2) if (prior.p_node1 == link->p_node1 && prior.p_node2 == link->p_node2 && bh_link_InBheapQ(prior)) {
- prior.linkkey.samecol -= 2;
+ ind_beg(amc_vis::node_zd_link_out_curs, out, *link->p_node2) if (bh_link_InBheapQ(out)) {
+ out.linkkey.samecol --;
+ amc_vis::bh_link_Reheap(out);
+ }ind_end;
+ ind_beg(amc_vis::node_zd_link_in_curs, prior, *link->p_node2) if (bh_link_InBheapQ(prior)) {
+ prior.linkkey.samecol--;
amc_vis::bh_link_Reheap(prior);
}ind_end;
}
@@ -75,38 +99,30 @@ static void Main_RowLayout() {
amc_vis::bh_link_Reheap(*from.p_link_to);
}ind_end;
}
-
- // allocate each field to a row
- // rows will be created later
- int next_outrow = 0;
- ind_beg(amc_vis::_db_c_linklist_curs, link, amc_vis::_db) {
- next_outrow += 1;
- if (&link == link.p_node2->c_top) {
- next_outrow += 1;
- }
- // allocate row
- link.outrow = next_outrow;
- // skip one row after bottom item
- if (&link == link.p_node2->c_bottom) {
- next_outrow += 1;
- }
- }ind_end;
}
// -----------------------------------------------------------------------------
+// Compute X position (column) for node NODE.
+// NODE's rows (top,bottom) have already been computed, now we have to place it
+// in such a way that it doesn't overlap any existing label
static i32 ComputeXpos(amc_vis::FNode *node) {
i32 xpos = 0;
if (amc_vis::_db.cmdline.render) {// save time if not rendering...
- ind_beg(amc_vis::_db_node_curs, prior, amc_vis::_db) if (&prior != node) {
- ind_beg(amc_vis::node_zd_link_out_curs, link, prior) {
- if (link.outrow >= node->c_top->outrow && link.outrow <= node->c_bottom->outrow) {
- xpos = i32_Max(xpos, prior.xpos + ch_N(link.label1));
- xpos = i32_Max(xpos, prior.xpos + ch_N(link.label2));
- } else if (link.p_node1->c_top->outrow <= node->c_top->outrow && link.p_node2->c_bottom->outrow >= node->c_bottom->outrow) {
- xpos = i32_Max(xpos, prior.xpos + 2);
- }
- }ind_end;
+ ind_beg(amc_vis::node_zd_link_in_curs, link, *node) if (link.p_node1 != node) {
+ int newpos = i32_Max(xpos, link.p_node1->xpos + i32_Max(ch_N(link.label1), ch_N(link.label2)) + 4);
+ xpos = newpos;
+ }ind_end;
+ ind_beg(amc_vis::_db_node_curs, prior, amc_vis::_db) if (&prior != node && !bh_node_InBheapQ(prior)) {
+ // place this column to the right of any column which overlaps it
+ if (i32_Max(prior.c_top->outrow, node->c_top->outrow) < i32_Min(prior.c_bottom->outrow, node->c_bottom->outrow)) {
+ i32 nodewid=ch_N(prior.label);
+ ind_beg(amc_vis::node_zd_link_out_curs, link, prior) {
+ nodewid = i32_Max(nodewid, ch_N(link.label1));
+ }ind_end;
+ int newpos = i32_Max(xpos, prior.xpos + nodewid + 4);
+ xpos = newpos;
+ }
}ind_end;
}
return xpos;
@@ -136,10 +152,12 @@ static void ShowCircular(amc_vis::FNode *node, int level) {
// -----------------------------------------------------------------------------
+// Check if reference indicates a dependency between types
+// for the purposes of column layout
static bool DepRefQ(amc_vis::FField &field) {
return field.p_arg != field.p_ctype
- && field.reftype != dmmeta_Reftype_reftype_Global
&& field.reftype != dmmeta_Reftype_reftype_Regx
+ && field.reftype != dmmeta_Reftype_reftype_Base
&& field.reftype != dmmeta_Reftype_reftype_RegxSql
&& field.reftype != dmmeta_Reftype_reftype_Hook;
}
@@ -152,7 +170,7 @@ static void Main_ColLayout() {
ind_beg(amc_vis::_db_node_curs, node, amc_vis::_db) {
ind_beg(amc_vis::ctype_c_field_curs, field, *node.p_ctype) {
amc_vis::FNode *node_to = amc_vis::ind_node_Find(field.arg);
- if (node_to != NULL && !field.p_reftype->isnew && DepRefQ(field)) {
+ if (node_to != NULL && DepRefQ(field)) {
amc_vis::FNodedep &nodedep = amc_vis::nodedep_Alloc();
nodedep.name = name_Get(field);
nodedep.reftype = field.reftype;
@@ -173,7 +191,6 @@ static void Main_ColLayout() {
ind_beg(amc_vis::_db_node_curs, node, amc_vis::_db) {
ind_beg(amc_vis::node_zd_nodedep_out_curs, nodedep, node) {
nodedep.p_node2->nodekey.n_ct_in++;
- nodedep.p_node2->nodekey.prev_xpos = ComputeXpos(&node);
}ind_end;
}ind_end;
@@ -191,12 +208,11 @@ static void Main_ColLayout() {
nerr++;
prlog("");
}
- node->xpos = ComputeXpos(node) + 4;
+ node->xpos = ComputeXpos(node);
// reduce dependency count for target columns
// can this loop around???
ind_beg(amc_vis::node_zd_nodedep_out_curs, nodedep, *node) if (amc_vis::bh_node_InBheapQ(*nodedep.p_node2)) {
nodedep.p_node2->nodekey.n_ct_in--;
- nodedep.p_node2->nodekey.prev_xpos = ComputeXpos(nodedep.p_node2);
amc_vis::bh_node_Reheap(*nodedep.p_node2);
}ind_end;
}
@@ -223,20 +239,20 @@ static void Main_Render() {
// create rows:
// each row is an array of chars.
while (amc_vis::outrow_N() < max_rows) {
- amc_vis::Outrow &outrow = amc_vis::outrow_Alloc();
+ amc_vis::FOutrow &outrow = amc_vis::outrow_Alloc();
vrfy(amc_vis::outrow_XrefMaybe(outrow), algo_lib::_db.errtext);
amc_vis::text_Reserve(outrow, screen_wid);
outrow.text_n = screen_wid;
- Fill(text_Getary(outrow), (unsigned char)' ');
+ Fill(text_Getary(outrow), u16(' '));
}
// draw arrows.
// these go left or right between columns
ind_beg(amc_vis::_db_c_linklist_curs, link, amc_vis::_db) if (link.p_node2 != link.p_node1) {
- algo::aryptr line = text_Getary(amc_vis::outrow_qFind(link.outrow));
+ algo::aryptr line = text_Getary(amc_vis::outrow_qFind(link.outrow));
bool rtol = link.p_node1->xpos > link.p_node2->xpos;
- char arrow = rtol ? '<' : '>';
+ u16 arrow = (rtol ? '<' : '>') | link.p_node2->p_ctype->color;
int left = link.p_node1->xpos;
int right = link.p_node2->xpos;
if (rtol) {
@@ -244,7 +260,7 @@ static void Main_Render() {
right = link.p_node1->xpos;
}
for (int i = left; i < right; i++) {
- line[i] = '-';
+ line[i] = ('-') | link.p_node2->p_ctype->color;
}
if (rtol) {
line[left] = arrow;
@@ -255,19 +271,18 @@ static void Main_Render() {
// render boxes -- for each node, extending from opener to bottom fields
ind_beg(amc_vis::_db_node_curs, node, amc_vis::_db) {
- amc_vis::Link &top = *node.c_top;
- amc_vis::Link &bot = *node.c_bottom;
+ amc_vis::FLink &top = *node.c_top;
+ amc_vis::FLink &bot = *node.c_bottom;
int left = node.xpos;
-
// draw the box
for (int y = top.outrow; y <= bot.outrow; y++) {
- amc_vis::Outrow &outrow = amc_vis::outrow_qFind(y);
- text_qFind(outrow, left) = y == top.outrow ? '/' : y == bot.outrow ? '-' : '|';
+ amc_vis::FOutrow &outrow = amc_vis::outrow_qFind(y);
+ text_qFind(outrow, left) = node.p_ctype->color | (y == top.outrow ? '/' : y == bot.outrow ? '-' : '|');
}
}ind_end;
ind_beg(amc_vis::_db_c_linklist_curs, link, amc_vis::_db) {
- algo::aryptr line = text_Getary(amc_vis::outrow_qFind(link.outrow));
+ algo::aryptr line = text_Getary(amc_vis::outrow_qFind(link.outrow));
// render left label
if (link.p_node1 && link.p_node1 != link.p_node2) {
@@ -282,14 +297,34 @@ static void Main_Render() {
int xleft = link.p_node2->xpos;
strptr s = link.label2;
frep_(i,elems_N(s)) {
- line[xleft + 2 + i] = s[i];
+ line[xleft + 2 + i] = link.p_node2->p_ctype->color | s[i];
}
}
}ind_end;
+ // automatically use pager if the output is too big
+ if (amc_vis::_db.hastty && (amc_vis::outrow_N() > amc_vis::_db.term_hei || screen_wid > amc_vis::_db.term_wid)) {
+ StartPager();
+ }
ind_beg(amc_vis::_db_outrow_curs, outrow, amc_vis::_db) {
- prlog(ToStrPtr(text_Getary(outrow)));
+ // Translate outrow to string, applying color
+ tempstr str;
+ algo::aryptr line = text_Getary(outrow);
+ int last_color=0;
+ for (int i=0; i>8) : 0;
+ char ch=line.elems[i]&0xff;
+ if (color != last_color) {
+ str << "\033["<c_top && field.p_reftype->isval) {
- amc_vis::Link &link = amc_vis::link_Alloc();
+ amc_vis::FLink &link = amc_vis::link_Alloc();
link.p_node1 = &node;
link.p_node2 = thatnode;
link.link = thatnode->node;
@@ -443,7 +505,7 @@ void amc_vis::Main() {
// create top and bottom fields for each node (if not already there).
ind_beg(amc_vis::_db_node_curs, node, amc_vis::_db) {
if (!node.c_top) {
- amc_vis::Link &link = amc_vis::link_Alloc();
+ amc_vis::FLink &link = amc_vis::link_Alloc();
link.p_node1 = &node;
link.p_node2 = &node;
link.link = node.node;
@@ -452,7 +514,7 @@ void amc_vis::Main() {
node.c_top = &link;
}
if (!node.c_bottom) {
- amc_vis::Link &link = amc_vis::link_Alloc();
+ amc_vis::FLink &link = amc_vis::link_Alloc();
link.p_node1 = &node;
link.p_node2 = &node;
link.link = tempstr() << node.node << ".";
@@ -467,7 +529,7 @@ void amc_vis::Main() {
ind_beg(amc_vis::ctype_c_field_curs, field, *node.p_ctype) {
amc_vis::FNode *thatnode = amc_vis::ind_node_Find(field.arg);
if (DepRefQ(field) && thatnode && !field.p_reftype->isval) {
- amc_vis::Link *link = &amc_vis::link_Alloc();
+ amc_vis::FLink *link = &amc_vis::link_Alloc();
link->link = field.field;
link->upptr = field.p_reftype->up;
link->label1 = tempstr() << field.reftype << " "<c_optfld || base->c_varlenfld));
+ && !(base && (base->c_optfld || !zd_varlenfld_EmptyQ(*base)));
return retval;
}
@@ -276,6 +276,22 @@ void amc::CloneFields(amc::FCtype &from, amc::FCtype &to, double next_rowid, amc
newpmaskfld.field = newfield.field;
amc::pmaskfld_InsertMaybe(newpmaskfld);
}
+ // TODO: need to map req and response header version to api versions:
+ // - non-flexible version of request matches ReqHeader V1
+ // - flexible version of request matches ReqHeader V2
+ // - non-flexible version of request matches RespHeader V0
+ // - flexible version of request matches RespHeader V1
+ // Use simplified logic for now
+ if (field.c_fkafka) {
+ dmmeta::Fkafka newfkafka;
+ newfkafka.field = newfield.field;
+ newfkafka.versions = to.c_ckafka ? strptr(to.c_ckafka->valid_versions) : strptr();
+ strptr name = name_Get(field);
+ if (name == "client_id") {
+ newfkafka.nullable_versions = to.c_ckafka ? strptr(to.c_ckafka->flexible_versions) : strptr();
+ }
+ amc::fkafka_InsertMaybe(newfkafka);
+ }
// throw away c_fldfoffset
vrfy(!fnewfield.c_xref, "cannot copy field with xref");
vrfy(!fnewfield.c_basepool, "cannot copy field with basepool");
diff --git a/cpp/amc/bheap.cpp b/cpp/amc/bheap.cpp
index 8d1ea08b..50d51164 100644
--- a/cpp/amc/bheap.cpp
+++ b/cpp/amc/bheap.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -52,15 +52,11 @@ void amc::tclass_Bheap() {
InsVar(R, field.p_ctype , "$Cpptype**", "$name_elems", "", "binary heap by $sortfld");
InsVar(R, field.p_ctype , "i32", "$name_n", "", "number of elements in the heap");
InsVar(R, field.p_ctype , "i32", "$name_max", "", "max elements in $name_elems");
-
- vrfy(!field.p_arg->c_varlenfld || !field.p_arg->c_varlenfld->processed
- , "no field can appear after varlen field.");
-
- InsVar(R, field.p_arg , "i32", "$name_idx", "", "index in heap; -1 means not-in-heap");
+ InsVar(R, field.p_arg , "i32", "$xfname_idx", "", "index in heap; -1 means not-in-heap");
amc::FFunc *child_init = amc::init_GetOrCreate(*field.p_arg);
Set(R, "$fname" , Refname(*field.p_arg));
- Ins(&R, child_init->body , "$fname.$name_idx = -1; // ($field) not-in-heap");
+ Ins(&R, child_init->body , "$fname.$xfname_idx = -1; // ($field) not-in-heap");
}
void amc::tfunc_Bheap_Upheap() {
@@ -79,7 +75,7 @@ void amc::tfunc_Bheap_Upheap() {
Ins(&R, up.body, " if (!$name_ElemLt($pararg, row, *p)) {");
Ins(&R, up.body, " break;");
Ins(&R, up.body, " }");
- Ins(&R, up.body, " p->$name_idx = idx;");
+ Ins(&R, up.body, " p->$xfname_idx = idx;");
Ins(&R, up.body, " elems[idx] = p;");
Ins(&R, up.body, " idx = j;");
Ins(&R, up.body, "}");
@@ -111,7 +107,7 @@ void amc::tfunc_Bheap_Downheap() {
Ins(&R, down.body, " if (!$name_ElemLt($pararg, *p,row)) {");
Ins(&R, down.body, " break;");
Ins(&R, down.body, " }");
- Ins(&R, down.body, " p->$name_idx = idx;");
+ Ins(&R, down.body, " p->$xfname_idx = idx;");
Ins(&R, down.body, " elems[idx] = p;");
Ins(&R, down.body, " idx = child;");
Ins(&R, down.body, " child = idx*2+1;");
@@ -128,7 +124,7 @@ void amc::tfunc_Bheap_Reheap() {
Ins(&R, reheap.comment, "Return new position of item in the heap (0=top)");
Ins(&R, reheap.ret , "i32", false);
Ins(&R, reheap.proto, "$name_Reheap($Parent, $Cpptype& row)", false);
- Ins(&R, reheap.body , "int old_idx = row.$name_idx;");
+ Ins(&R, reheap.body , "int old_idx = row.$xfname_idx;");
Ins(&R, reheap.body , "bool isnew = old_idx == -1;");
Ins(&R, reheap.body , "if (isnew) {");
Ins(&R, reheap.body , " $name_Reserve($pararg, 1);");
@@ -138,7 +134,7 @@ void amc::tfunc_Bheap_Reheap() {
Ins(&R, reheap.body , "if (!isnew && new_idx == old_idx) {");
Ins(&R, reheap.body , " new_idx = $name_Downheap($pararg, row, old_idx);");
Ins(&R, reheap.body , "}");
- Ins(&R, reheap.body , "row.$name_idx = new_idx;");
+ Ins(&R, reheap.body , "row.$xfname_idx = new_idx;");
Ins(&R, reheap.body , "$parname.$name_elems[new_idx] = &row;");
if (field.need_firstchanged) {
Ins(&R, reheap.comment, "If first item of the is changed, update fstep:$field");
@@ -163,7 +159,7 @@ void amc::tfunc_Bheap_ReheapFirst() {
Ins(&R, reheapfirst.proto, "$name_ReheapFirst($Parent)", false);
Ins(&R, reheapfirst.body , "$Cpptype &row = *$parname.$name_elems[0];");
Ins(&R, reheapfirst.body , "i32 new_idx = $name_Downheap($pararg, row, 0);");
- Ins(&R, reheapfirst.body , "row.$name_idx = new_idx;");
+ Ins(&R, reheapfirst.body , "row.$xfname_idx = new_idx;");
Ins(&R, reheapfirst.body , "$parname.$name_elems[new_idx] = &row;");
if (field.need_firstchanged) {
Ins(&R, reheapfirst.comment, "Update fstep:$field");
@@ -186,7 +182,7 @@ void amc::tfunc_Bheap_Set() {
Ins(&R, set.proto, "$sortfld_Set($Parent, $Cpptype &row, $Sortfldstore new_key)", false);
Ins(&R, set.body, "row.$sortfld = new_key;");
if (field.need_firstchanged) {
- Ins(&R, set.body, "int old_idx = row.$name_idx;");
+ Ins(&R, set.body, "int old_idx = row.$xfname_idx;");
}
Ins(&R, set.body, "bool ins = $inscond; // user-defined insert condition (xref)");
Ins(&R, set.body, "if (ins) {");
@@ -195,7 +191,7 @@ void amc::tfunc_Bheap_Set() {
Ins(&R, set.body, " $name_Remove($pararg, row);");
Ins(&R, set.body, "}");
if (field.need_firstchanged) {
- Ins(&R, set.body, "int new_idx = row.$name_idx;");
+ Ins(&R, set.body, "int new_idx = row.$xfname_idx;");
Ins(&R, set.body, "bool changed = new_idx==0 || old_idx==0;");
Ins(&R, set.body, "// detect changes in the heap top.");
Ins(&R, set.body, "// this is overly loose -- it may be that row is the top element");
@@ -239,7 +235,7 @@ void amc::tfunc_Bheap_Cascdel() {
Ins(&R, cascdel.body, "while (n > 0) {");
Ins(&R, cascdel.body, " n--;");
Ins(&R, cascdel.body, " $Cpptype &elem = *$parname.$name_elems[n]; // pick cheapest element to remove");
- Ins(&R, cascdel.body, " elem.$name_idx = -1; // mark not-in-heap");
+ Ins(&R, cascdel.body, " elem.$xfname_idx = -1; // mark not-in-heap");
Ins(&R, cascdel.body, " $parname.$name_n = n;");
Ins(&R, cascdel.body, DeleteExpr(field,"$pararg","elem")<<";");
Ins(&R, cascdel.body, "}");
@@ -257,13 +253,13 @@ void amc::tfunc_Bheap_RemoveFirst() {
Ins(&R, remfirst.body, "$Cpptype *row = NULL;");
Ins(&R, remfirst.body, "if ($parname.$name_n > 0) {");
Ins(&R, remfirst.body, " row = $parname.$name_elems[0];");
- Ins(&R, remfirst.body, " row->$name_idx = -1; // mark not in heap");
+ Ins(&R, remfirst.body, " row->$xfname_idx = -1; // mark not in heap");
Ins(&R, remfirst.body, " i32 n = $parname.$name_n - 1; // index of last element in heap");
Ins(&R, remfirst.body, " $parname.$name_n = n; // decrease count");
Ins(&R, remfirst.body, " if (n) {");
Ins(&R, remfirst.body, " $Cpptype &elem = *$parname.$name_elems[n];");
Ins(&R, remfirst.body, " int new_idx = $name_Downheap($pararg, elem, 0);");
- Ins(&R, remfirst.body, " elem.$name_idx = new_idx;");
+ Ins(&R, remfirst.body, " elem.$xfname_idx = new_idx;");
Ins(&R, remfirst.body, " $parname.$name_elems[new_idx] = &elem;");
Ins(&R, remfirst.body, " }");
if (field.need_firstchanged) {
@@ -291,7 +287,7 @@ void amc::tfunc_Bheap_InBheapQ() {
Ins(&R, inheap.ret , "bool", false);
Ins(&R, inheap.proto, "$name_InBheapQ($Cpptype& row)", false);
Ins(&R, inheap.body, "bool result = false;");
- Ins(&R, inheap.body, "result = row.$name_idx != -1;");
+ Ins(&R, inheap.body, "result = row.$xfname_idx != -1;");
Ins(&R, inheap.body, "return result;");
}
@@ -303,12 +299,12 @@ void amc::tfunc_Bheap_Insert() {
Ins(&R, insert.comment, "Insert row. Row must not already be in index. If row is already in index, do nothing.", false);
Ins(&R, insert.ret , "void", false);
Ins(&R, insert.proto, "$name_Insert($Parent, $Cpptype& row)", false);
- Ins(&R, insert.body, "if (LIKELY(row.$name_idx == -1)) {");
+ Ins(&R, insert.body, "if (LIKELY(row.$xfname_idx == -1)) {");
Ins(&R, insert.body, " $name_Reserve($pararg, 1);");
Ins(&R, insert.body, " int n = $parname.$name_n;");
Ins(&R, insert.body, " $parname.$name_n = n + 1;");
Ins(&R, insert.body, " int new_idx = $name_Upheap($pararg, row, n);");
- Ins(&R, insert.body, " row.$name_idx = new_idx;");
+ Ins(&R, insert.body, " row.$xfname_idx = new_idx;");
Ins(&R, insert.body, " $parname.$name_elems[new_idx] = &row;");
if (field.need_firstchanged) {
Ins(&R, insert.body, " if (new_idx==0) {");
@@ -347,9 +343,9 @@ void amc::tfunc_Bheap_Remove() {
Ins(&R, remove.ret , "void", false);
Ins(&R, remove.proto, "$name_Remove($Parent, $Cpptype& row)", false);
Ins(&R, remove.body , "if ($name_InBheapQ(row)) {");
- Ins(&R, remove.body , " int old_idx = row.$name_idx;");
+ Ins(&R, remove.body , " int old_idx = row.$xfname_idx;");
Ins(&R, remove.body , " if ($parname.$name_elems[old_idx] == &row) { // sanity check: heap points back to row");
- Ins(&R, remove.body , " row.$name_idx = -1; // mark not in heap");
+ Ins(&R, remove.body , " row.$xfname_idx = -1; // mark not in heap");
Ins(&R, remove.body , " i32 n = $parname.$name_n - 1; // index of last element in heap");
Ins(&R, remove.body , " $parname.$name_n = n; // decrease count");
Ins(&R, remove.body , " if (old_idx != n) {");
@@ -358,7 +354,7 @@ void amc::tfunc_Bheap_Remove() {
Ins(&R, remove.body , " if (new_idx == old_idx) {");
Ins(&R, remove.body , " new_idx = $name_Downheap($pararg, *elem, old_idx);");
Ins(&R, remove.body , " }");
- Ins(&R, remove.body , " elem->$name_idx = new_idx;");
+ Ins(&R, remove.body , " elem->$xfname_idx = new_idx;");
Ins(&R, remove.body , " $parname.$name_elems[new_idx] = elem;");
Ins(&R, remove.body , " }");
if (field.c_fcompact) {
@@ -403,7 +399,7 @@ void amc::tfunc_Bheap_RemoveAll() {
Ins(&R, flush.proto, "$name_RemoveAll($Parent)", false);
Ins(&R, flush.body , "int n = $parname.$name_n;");
Ins(&R, flush.body , "for (int i = n - 1; i>=0; i--) {");
- Ins(&R, flush.body , " $parname.$name_elems[i]->$name_idx = -1; // mark not-in-heap");
+ Ins(&R, flush.body , " $parname.$name_elems[i]->$xfname_idx = -1; // mark not-in-heap");
Ins(&R, flush.body , "}");
Ins(&R, flush.body , "$parname.$name_n = 0;");
if (field.need_firstchanged) {
@@ -681,7 +677,7 @@ void amc::tfunc_Bheap_curs() {
Ins(&R, curs_next.body, " i = l;");
Ins(&R, curs_next.body, " } while (i < n);");
Ins(&R, curs_next.body, " curs.temp_n = n-1;");
- Ins(&R, curs_next.body, " int index = dead->$name_idx;");
+ Ins(&R, curs_next.body, " int index = dead->$xfname_idx;");
Ins(&R, curs_next.body, " i = (index*2+1);");
Ins(&R, curs_next.body, " if (i < $name_N($curspararg)) {");
Ins(&R, curs_next.body, " $Cpptype &elem = *curs.parent->$name_elems[i];");
diff --git a/cpp/amc/bitfld.cpp b/cpp/amc/bitfld.cpp
index 1dc1e54e..c042496c 100644
--- a/cpp/amc/bitfld.cpp
+++ b/cpp/amc/bitfld.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
diff --git a/cpp/amc/bitset.cpp b/cpp/amc/bitset.cpp
index 2cbfe7c9..84495da0 100644
--- a/cpp/amc/bitset.cpp
+++ b/cpp/amc/bitset.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/blkpool.cpp b/cpp/amc/blkpool.cpp
index 39e97a7d..1ca79f31 100644
--- a/cpp/amc/blkpool.cpp
+++ b/cpp/amc/blkpool.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
diff --git a/cpp/amc/cget.cpp b/cpp/amc/cget.cpp
index 321af006..8f1d363f 100644
--- a/cpp/amc/cget.cpp
+++ b/cpp/amc/cget.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -29,6 +29,7 @@ static amc::FFunc* CreateFunc(amc::FCtype& ctype, strptr fconst){
tempstr name(fconst);
Translate(name, ".", "_");
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$Ns" , ns_Get(ctype));
Set(R, "$Ctype" , name_Get(ctype));
Set(R, "$Fname" , name);
@@ -51,6 +52,7 @@ static amc::FFunc* CreateFunc(amc::FCtype& ctype, strptr fconst){
static void GenBoolFunc(amc::FCtype& ctype, amc::FField& field){
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$Field" , name_Get(field));
amc::FFunc* func = CreateFunc(ctype, Subst(R, "$FieldQ"));
if(func){
@@ -61,6 +63,7 @@ static void GenBoolFunc(amc::FCtype& ctype, amc::FField& field){
static void GenInlineFconstFunc(amc::FCtype& ctype, amc::FField& field, amc::FFconst& fconst){
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$Field" , FieldvalExpr(NULL, field, "row"));
Set(R, "$Fconst" , name_Get(fconst));
Set(R, "$Constval" , fconst.cpp_name);
@@ -74,6 +77,7 @@ static void GenInlineFconstFunc(amc::FCtype& ctype, amc::FField& field, amc::FFc
static void GenFarFconstFunc(amc::FCtype& ctype, amc::FField& field, amc::FCtype& arg){
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$Ns" , ns_Get(ctype));
Set(R, "$Ctype" , name_Get(ctype));
Set(R, "$Field" , FieldvalExpr(NULL, field, "row"));
diff --git a/cpp/amc/charset.cpp b/cpp/amc/charset.cpp
index 5de12653..b11ba4ba 100644
--- a/cpp/amc/charset.cpp
+++ b/cpp/amc/charset.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -59,8 +59,8 @@ void amc::tclass_Charset() {
if (!charset->calc) {
amc::FFunc *init = &amc::ind_func_GetOrCreate(tempstr() << field.field <<".Init");
init->ismacro = true;
- Set(R, "$name", name_Get(field));
- Set(R, "$cppstr", ToCppStringExpr(charset->expr));
+ Set(R, "$name", name_Get(field), false);
+ Set(R, "$cppstr", ToCppStringExpr(charset->expr), false);
// insert struct field
InsVar(R, field.p_ctype, field.p_arg->cpp_type, name_Get(field), "", field.comment);
if (charset->charrange) {
diff --git a/cpp/amc/checkxref.cpp b/cpp/amc/checkxref.cpp
index a8ab061f..d261eb32 100644
--- a/cpp/amc/checkxref.cpp
+++ b/cpp/amc/checkxref.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -202,7 +202,9 @@ static void CheckXref_Impossible(amc::FXref &xref) {
amc::FField &field = *xref.p_field;
// I temporarily allowed x-refs across namespace, but this quickly
// turned out to be a bad idea (Upptr is an exception)
- if (field.reftype != dmmeta_Reftype_reftype_Upptr && !(amc::ns_Get(*field.p_ctype) == amc::ns_Get(*field.p_arg))) {
+ if (field.reftype != dmmeta_Reftype_reftype_Upptr
+ && field.reftype != dmmeta_Reftype_reftype_Ptr
+ && !(amc::ns_Get(*field.p_ctype) == amc::ns_Get(*field.p_arg))) {
prerr("amc.xref_across_namespace"
<set) {
Set(R, "$Fldargtype", Argtype(field));
amc::FFunc& set = amc::CreateCurFunc();
+ set.acrkey << "cppfunc:"<body)) {
Set(R, "$field", field.field);
+ Set(R, "$comment", field.comment, false);
Ins(&R, uninit.body, "");
- Ins(&R, uninit.body, tempstr()<<"// $field.Uninit ("<body;
uninit.inl = uninit.inl && func->inl;
naction++;
@@ -290,8 +292,8 @@ void amc::tfunc_Ctype_Hash() {
amc::FCtype &ctype = *amc::_db.genctx.p_ctype;
amc::FNs &ns = *ctype.p_ns;
- if (ctype.c_chash) {
- vrfy(!ctype.c_varlenfld,tempstr()<< "hash function of varlength records is not supported ("<hashtype != dmmeta_Hashtype_hashtype_Linear) {
+ vrfy(zd_varlenfld_EmptyQ(ctype),tempstr()<< "hash function of varlength records is not supported ("<hashtype == dmmeta_Hashtype_hashtype_Extern;
hash.inl = c_datafld_N(ctype) < 5;
- ind_beg(amc::ctype_c_field_curs, field, ctype) {
- if (PadQ(field)) {
- } else if (FldfuncQ(field)) {
- } else if (field.c_smallstr) {
- hash.inl=false;
- Set(R, "$name", name_Get(field));
- Ins(&R, hash.body, "algo::strptr $name_strptr = $name_Getary(rhs);");
- Ins(&R, hash.body, "prev = ::strptr_Hash(prev, $name_strptr);");
- } else if (field.reftype == dmmeta_Reftype_reftype_Ptr) {
- Set(R, "$name", name_Get(field));
- Ins(&R, hash.body, "prev = u64_Hash(prev, u64(rhs.$name));");
- } else if (field.reftype == dmmeta_Reftype_reftype_Upptr) {
- Set(R, "$name", name_Get(field));
- Ins(&R, hash.body, "prev = u64_Hash(prev, u64(rhs.$name));");
- } else if (FixaryQ(field)) {
- Set(R, "$Fldname", name_Get(*field.p_arg));
- Set(R, "$name", name_Get(field));
- Set(R, "$width", tempstr() << WidthMin(field));
- Ins(&R, hash.body, "frep_(i,$width) prev = $Fldname_Hash(prev, rhs.$name_elems[i]);");
- } else if (ValQ(field)) {
- Set(R, "$Fldname", name_Get(*field.p_arg));
- Set(R, "$gethashfld", FieldvalExpr(&ctype, field,"rhs"));
- Ins(&R, hash.body, tempstr()<<"prev = $Fldname_Hash(prev, $gethashfld);");
+ if (ctype.c_bltin) {
+ vrfy(ctype.c_csize, tempstr()<<"csize record missing for bltin "<size;
+ if (size <= 8 && ctype.c_bltin->likeu64) {
+ // use an intrinsic without taking address
+ Set(R, "$wordsize", tempstr()<size*8);
+ Ins(&R, hash.body, "prev = _mm_crc32_u$wordsize(prev,rhs);");
+ } else {
+ // go over the bytes
+ int offset=0;
+ Ins(&R, hash.body, "#pragma GCC diagnostic push");
+ Ins(&R, hash.body, "#pragma GCC diagnostic ignored \"-Wstrict-aliasing\"");
+ for (int wordsize=8; wordsize >= 1; wordsize = wordsize/2) {
+ for (; size >= wordsize; size -= wordsize, offset += wordsize) {
+ Set(R, "$offset", tempstr()<c_bltin && field.p_arg->c_csize && field.p_arg->c_csize->size < 8) {
+ // hash builtin types as strings
+ // i.e. an array of 2 u32s will not hash to the same value
+ // as two u32 fields, but that's ok because there is no expectation of
+ // that behavior
+ // for types over 8 bytes in length, it's better to compute element-by-element
+ Ins(&R, hash.body, "prev = strptr_Hash(prev, algo::strptr((char*)rhs.$name_elems,rhs.$name_n));");
+ } else {
+ Ins(&R, hash.body, "ind_beg($Parname_$name_curs,elem,($Partype&)rhs) {");
+ Ins(&R, hash.body, " prev = $Fldtype_Hash(prev,elem);");
+ Ins(&R, hash.body, "}ind_end;");
+ }
+ } else if (field.reftype == dmmeta_Reftype_reftype_Upptr) {
+ Ins(&R, hash.body, "prev = u64_Hash(prev, u64(rhs.$name));");
+ } else if (FixaryQ(field)) {
+ Set(R, "$width", tempstr() << WidthMin(field));
+ Ins(&R, hash.body, "frep_(i,$width) prev = $Fldtype_Hash(prev, rhs.$name_elems[i]);");
+ } else if (ValQ(field)) {
+ Set(R, "$Fldtype", name_Get(*field.p_arg));
+ Set(R, "$gethashfld", FieldvalExpr(&ctype, field,"rhs"));
+ Ins(&R, hash.body, tempstr()<<"prev = $Fldtype_Hash(prev, $gethashfld);");
+ }
+ }ind_end;
+ }
Ins(&R, hash.body, "return prev;");
}
}
@@ -338,7 +379,7 @@ void amc::tfunc_Ctype_Cmp() {
algo_lib::Replscope &R = amc::_db.genctx.R;
amc::FCtype &ctype = *amc::_db.genctx.p_ctype;
if (ctype.c_ccmp) {
- vrfy(!ctype.c_varlenfld,tempstr()<< "comparison function of varlength records is not supported ("<extrn;
cmp.inl = c_datafld_N(ctype) < 4;
- Ins(&R, cmp.body , "i32 retval = 0;");
- bool need_test = false;
- ind_beg(amc::ctype_c_datafld_curs, field,ctype) {
- tempstr test;
- if (PadQ(field)) {
- } else if (amc::ind_func_Find(dmmeta::Func_Concat_field_name(field.field,"Cmp"))) {// check field-spsecific compare
- Set(R, "$name", name_Get(field));
- Ins(&R, test , "retval = $name_Cmp(lhs,rhs);");
- } else if (field.reftype == dmmeta_Reftype_reftype_Upptr || field.reftype == dmmeta_Reftype_reftype_Ptr) {// default for pointers
- Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
- Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
- Set(R, "$Fldtype", field.p_arg->cpp_type);
- Ins(&R, test, "retval = u64_Cmp((u64)(void*)$a_val, (u64)(void*)$b_val);");
- } else if (field.reftype == dmmeta_Reftype_reftype_Smallstr) {// default for small strings
- Set(R, "$name", name_Get(field));
- Ins(&R, test, "retval = algo::strptr_Cmp($name_Getary(lhs), $name_Getary(rhs));");
- } else if (field.reftype == dmmeta_Reftype_reftype_Base) {
- // compare bases???
- } else if (field.p_arg->c_ccmp) {// type-specific compare
- Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
- Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
- Set(R, "$Fldtype", field.p_arg->cpp_type);
- Ins(&R, test, "retval = $Fldtype_Cmp($a_val, $b_val);");
- } else {
- prerr("amc.bad_cmp"
- < 0) {
- if (need_test) {
- Ins(&R, cmp.body, "if (retval != 0) {");
- Ins(&R, cmp.body, " return retval;");
- Ins(&R, cmp.body, "}");
+ AddRetval(cmp, "i32", "retval", "0");
+ if (ctype.c_bltin) {
+ Ins(&R, cmp.body, "retval = lhsrhs;");
+ } else {
+ bool need_test = false;
+ ind_beg(amc::ctype_c_datafld_curs, field,ctype) {
+ tempstr test;
+ if (PadQ(field)) {
+ } else if (amc::ind_func_Find(dmmeta::Func_Concat_field_name(field.field,"Cmp"))) {// check field-spsecific compare
+ Set(R, "$name", name_Get(field));
+ Ins(&R, test , "retval = $name_Cmp(lhs,rhs);");
+ } else if (field.reftype == dmmeta_Reftype_reftype_Upptr || field.reftype == dmmeta_Reftype_reftype_Ptr) {// default for pointers
+ Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
+ Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
+ Set(R, "$Fldtype", field.p_arg->cpp_type);
+ Ins(&R, test, "retval = u64_Cmp((u64)(void*)$a_val, (u64)(void*)$b_val);");
+ } else if (field.reftype == dmmeta_Reftype_reftype_Smallstr) {// default for small strings
+ Set(R, "$name", name_Get(field));
+ Ins(&R, test, "retval = algo::strptr_Cmp($name_Getary(lhs), $name_Getary(rhs));");
+ } else if (field.reftype == dmmeta_Reftype_reftype_Base) {
+ // base fields have been already copied over
+ } else if (field.p_arg->c_ccmp) {// type-specific compare
+ Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
+ Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
+ Set(R, "$Fldtype", field.p_arg->cpp_type);
+ Ins(&R, test, "retval = $Fldtype_Cmp($a_val, $b_val);");
+ } else {
+ prerr("amc.bad_cmp"
+ < 0) {
+ if (need_test) {
+ Ins(&R, cmp.body, "if (retval != 0) {");
+ Ins(&R, cmp.body, " return retval;");
+ Ins(&R, cmp.body, "}");
+ }
+ cmp.body << test;
+ need_test = true;
+ }
+ }ind_end;
+ }
}
}
@@ -436,11 +480,13 @@ void amc::tfunc_Ctype_Lt() {
Ins(&R, oplt.proto, "$Name_Lt($ByvalArgtype lhs, $ByvalArgtype rhs)", false);
oplt.extrn = ctype.c_ccmp->extrn;
oplt.inl = true;
- // Lt function is faster than Cmp because there are fewer calculations to do
- // But if there is more than one field the advantage goes away because if a.x is not less
- // than b.x, you would have to check whether a.x==b.x before proceeding to the next field
- // So if there is more than one field, we revert to the generic Cmp.
- if (c_datafld_N(ctype) == 1) { // special case -- single field.
+ if (ctype.c_bltin) {
+ Ins(&R, oplt.body , "return lhs < rhs;");
+ } else if (c_datafld_N(ctype) == 1) { // special case -- single field.
+ // Lt function is faster than Cmp because there are fewer calculations to do
+ // But if there is more than one field the advantage goes away because if a.x is not less
+ // than b.x, you would have to check whether a.x==b.x before proceeding to the next field
+ // So if there is more than one field, we revert to the generic Cmp.
Ctype_Lt_SingleField(R,ctype,oplt);
} else {
Ins(&R, oplt.body , "return $Name_Cmp(lhs,rhs) < 0;");
@@ -468,11 +514,7 @@ void amc::tfunc_Ctype_Init() {
if (field.c_fuserinit) {
Set(R, "$field", field.field);
Set(R, "$name", name_Get(field));
- if (glob) {
- Ins(&R, text, "Userinit(); // dmmeta.fuserinit:$field");
- } else {
- Ins(&R, text, "$name_Userinit($pararg); // dmmeta.fuserinit:$field");
- }
+ Ins(&R, text, "$name_Userinit(); // dmmeta.fuserinit:$field");
}
}ind_end;
@@ -623,7 +665,7 @@ void amc::tfunc_Ctype_Eq() {
amc::FCtype &ctype = *amc::_db.genctx.p_ctype;
if (ctype.c_ccmp) {
- vrfy(!ctype.c_varlenfld,tempstr()<< "comparison function of varlength records is not supported ("<extrn;
opeq.inl = c_datafld_N(ctype) < 4;
bool need_test = false;
- ind_beg(amc::ctype_c_datafld_curs, field,ctype) {
- tempstr test;
- if (PadQ(field)) {
- } else if (amc::ind_func_Find(dmmeta::Func_Concat_field_name(field.field,"Eq"))) {
- Set(R, "$name", name_Get(field));
- Ins(&R, test, "retval = $name_Eq(lhs,rhs);");
- } else if (field.reftype == dmmeta_Reftype_reftype_Upptr || field.reftype == dmmeta_Reftype_reftype_Ptr) {// default for pointers
- Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
- Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
- Set(R, "$Fldtype", field.p_arg->cpp_type);
- Ins(&R, test, "retval = u64_Eq((u64)(void*)$a_val, (u64)(void*)$b_val);");
- } else if (field.reftype == dmmeta_Reftype_reftype_Smallstr) {// default for small strings
- Set(R, "$name", name_Get(field));
- if (!GenSmallstrEq(R, field, test)) {
- Ins(&R, test, "retval = algo::strptr_Eq($name_Getary(lhs), $name_Getary(rhs));");
+ if (ctype.c_bltin) {
+ Ins(&R, opeq.body, "retval = lhs == rhs;");
+ } else {
+ ind_beg(amc::ctype_c_datafld_curs, field,ctype) {
+ tempstr test;
+ if (PadQ(field)) {
+ } else if (amc::ind_func_Find(dmmeta::Func_Concat_field_name(field.field,"Eq"))) {
+ Set(R, "$name", name_Get(field));
+ Ins(&R, test, "retval = $name_Eq(lhs,rhs);");
+ } else if (field.reftype == dmmeta_Reftype_reftype_Upptr || field.reftype == dmmeta_Reftype_reftype_Ptr) {// default for pointers
+ Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
+ Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
+ Set(R, "$Fldtype", field.p_arg->cpp_type);
+ Ins(&R, test, "retval = u64_Eq((u64)(void*)$a_val, (u64)(void*)$b_val);");
+ } else if (field.reftype == dmmeta_Reftype_reftype_Smallstr) {// default for small strings
+ Set(R, "$name", name_Get(field));
+ if (!GenSmallstrEq(R, field, test)) {
+ Ins(&R, test, "retval = algo::strptr_Eq($name_Getary(lhs), $name_Getary(rhs));");
+ }
+ } else if (field.reftype == dmmeta_Reftype_reftype_Base) {
+ // fields have already been imported, ignore
+ } else if (field.p_arg->c_ccmp) {// type-specific compare
+ Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
+ Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
+ Set(R, "$Fldtype", field.p_arg->cpp_type);
+ Ins(&R, test, "retval = $Fldtype_Eq($a_val, $b_val);");
+ } else {
+ Set(R, "$name", name_Get(field));
+ Set(R,"$suffix",field.c_fbigend?"_be":"");
+ // hack: bigend fields do not need swapping to compare
+ Ins(&R, test, "retval = lhs.$name$suffix==rhs.$name$suffix;");
}
- } else if (field.reftype == dmmeta_Reftype_reftype_Base) {
- // fields have already been imported, ignore
- } else if (field.p_arg->c_ccmp) {// type-specific compare
- Set(R, "$a_val", FieldvalExpr(&ctype, field, "lhs"));
- Set(R, "$b_val", FieldvalExpr(&ctype, field, "rhs"));
- Set(R, "$Fldtype", field.p_arg->cpp_type);
- Ins(&R, test, "retval = $Fldtype_Eq($a_val, $b_val);");
- } else {
- Set(R, "$name", name_Get(field));
- Set(R,"$suffix",field.c_fbigend?"_be":"");
- // hack: bigend fields do not need swapping to compare
- Ins(&R, test, "retval = lhs.$name$suffix==rhs.$name$suffix;");
- }
- if (ch_N(test) > 0) {
- if (need_test) {
- Ins(&R, opeq.body, "if (!retval) {");
- Ins(&R, opeq.body, " return false;");
- Ins(&R, opeq.body, "}");
+ if (ch_N(test) > 0) {
+ if (need_test) {
+ Ins(&R, opeq.body, "if (!retval) {");
+ Ins(&R, opeq.body, " return false;");
+ Ins(&R, opeq.body, "}");
+ }
+ opeq.body << test;
+ need_test = true;
}
- opeq.body << test;
- need_test = true;
- }
- }ind_end;
+ }ind_end;
+ }
}
}
@@ -742,10 +788,10 @@ void amc::tfunc_Ctype_NArgs() {
Set(R, "$emptyval",actualfield->c_fflag->emptyval);
comment<<"dmmeta.fflag: emptyval specified; no argument required but value may be specified as $name:value";
}
+ Set(R,"$comment",comment);
Ins(&R, func.body, "case $ns_FieldId_$name: { // $comment");
Ins(&R, func.body, " *out_anon = $isanon;");
if (nargs==0) {
- Set(R,"$comment",comment);
Ins(&R, func.body, " retval=0;");
Ins(&R, func.body, " out_dflt=$emptyval;");
}
@@ -890,7 +936,7 @@ void amc::tfunc_Ctype2_Ctor() {
amc::FFunc *init = amc::ind_func_Find(tempstr() << ctype.ctype << "..Init");
amc::FFunc &ctor = amc::CreateCurFunc();
ctor.member=true;
- ctor.isprivate = PoolHasAllocQ(ctype);
+ ctor.isprivate = FindPool(ctype)!=NULL;
ctor.inl=true;
Ins(&R, ctor.proto, "$Name()", false);
@@ -1132,8 +1178,7 @@ void amc::tfunc_Ctype2_Dtor() {
if (!GlobalQ(ctype) && !ctype.c_cextern && uninit && !uninit->disable) {
amc::FFunc &func = amc::CreateCurFunc();
func.member=true;
- // can we make this private?
- func.isprivate = PoolHasAllocQ(ctype);
+ func.isprivate = FindPool(ctype)!=0;
func.inl=true;
Ins(&R, func.proto, "~$Name()", false);
diff --git a/cpp/amc/delptr.cpp b/cpp/amc/delptr.cpp
index 608b51ed..96ba20d9 100644
--- a/cpp/amc/delptr.cpp
+++ b/cpp/amc/delptr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/amc/dflt.cpp b/cpp/amc/dflt.cpp
index 14aa7b0f..e101e0f1 100644
--- a/cpp/amc/dflt.cpp
+++ b/cpp/amc/dflt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2023 Astra
// Copyright (C) 2019 NYSE | Intercontinental Exchange
//
diff --git a/cpp/amc/disp/call.cpp b/cpp/amc/disp/call.cpp
index 559bd1bd..c68b8741 100644
--- a/cpp/amc/disp/call.cpp
+++ b/cpp/amc/disp/call.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -51,16 +51,17 @@ static void AddCtxProtoArg(amc::FDispatch &dispatch, amc::FFunc &func) {
}
static void Call_msgname(algo_lib::Replscope &R, amc::FDispatch &dispatch) {
- ind_beg(amc::dispatch_c_dispatch_msg_curs, msg,dispatch) {
- Set(R, "$msgname", StripNs("",ctype_Get(msg)));
- Set(R, "$msgns", GetNs(ctype_Get(msg)));
+ ind_beg(amc::dispatch_c_dispatch_msg_curs, dispatch_msg,dispatch) {
+ Set(R, "$msgname", StripNs("",ctype_Get(dispatch_msg)));
+ Set(R, "$msgns", GetNs(ctype_Get(dispatch_msg)));
amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$ns.$Disp.$msgns.$msgname"));
+ func.acrkey <<"dispatch_msg:"<cpp_type << " &", "msg");
+ amc::AddProtoArg(func, tempstr() << dispatch_msg.p_ctype->cpp_type << " &", "msg");
amc::AddProtoArg(func, "u32", "msg_len", dispatch.haslen);
}
}ind_end;
@@ -141,7 +142,7 @@ static void Call_Hdr(algo_lib::Replscope &R, amc::FDispatch &dispatch) {
func.glob = true;
Ins(&R, func.proto, "$DispDispatch()", false); {
AddCtxProtoArg(dispatch,func);
- amc::AddProtoArg(func, amc::Refto(dispatch.p_ctype_hdr->cpp_type)<<" ", "msg");
+ amc::AddProtoArg(func, amc::Refto(dispatch.p_ctype_hdr->cpp_type), "msg");
amc::AddProtoArg(func, "u32", "msg_len", dispatch.haslen);
}
// expression to access the value of the type field
@@ -169,7 +170,7 @@ static void Call_Hdr2(algo_lib::Replscope &R, amc::FDispatch &dispatch) {
Ins(&R, func.comment, "void rettype useful for hooks", false);
Ins(&R, func.proto , "v$DispDispatch()", false); {
AddCtxProtoArg(dispatch,func);
- amc::AddProtoArg(func, amc::Refto(dispatch.p_ctype_hdr->cpp_type)<<" ", "msg");
+ amc::AddProtoArg(func, amc::Refto(dispatch.p_ctype_hdr->cpp_type), "msg");
amc::AddProtoArg(func, "u32", "msg_len", dispatch.haslen);
}
Ins(&R, func.body , "$DispDispatch();"); {
@@ -184,12 +185,13 @@ static void Call_Hdr2(algo_lib::Replscope &R, amc::FDispatch &dispatch) {
// Declaration for user-provided function for the default case
static void Call_Unkmsg(algo_lib::Replscope &R, amc::FDispatch &dispatch) {
amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$ns.$Disp..Unkmsg"));
+ func.acrkey <<"dispatch:"<cpp_type)<<" ", "msg");
+ amc::AddProtoArg(func, amc::Refto(dispatch.p_ctype_hdr->cpp_type), "msg");
amc::AddProtoArg(func, "u32", "msg_len", dispatch.haslen);
}
}
diff --git a/cpp/amc/disp/casetype.cpp b/cpp/amc/disp/casetype.cpp
index 38d1f469..a78bf856 100644
--- a/cpp/amc/disp/casetype.cpp
+++ b/cpp/amc/disp/casetype.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/amc/disp/del.cpp b/cpp/amc/disp/del.cpp
new file mode 100644
index 00000000..d961a3dc
--- /dev/null
+++ b/cpp/amc/disp/del.cpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2025-2026 AlgoRND
+//
+// License: GPL
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Target: amc (exe) -- Algo Model Compiler: generate code under include/gen and cpp/gen
+// Exceptions: NO
+// Source: cpp/amc/disp/del.cpp
+//
+
+#include "include/amc.h"
+
+// Generate Dispatch_Delete function
+void amc::Disp_Delete(amc::FDispatch &disp) {
+ algo_lib::Replscope R;
+ R.strict=2;
+ Set(R, "$ns", ns_Get(disp));
+ Set(R, "$Hdrtype", amc::NsToCpp(disp.p_ctype_hdr->ctype));
+ Set(R, "$Dname", name_Get(disp));
+ Set(R, "$typefld", FieldvalExpr(disp.p_ctype_hdr, *disp.p_ctype_hdr->c_typefld->p_field, "msg"));
+
+ amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$ns.$Dname..Delete"));
+ func.glob = true;
+ func.ret = "void";
+ Ins(&R, func.comment, "Delete message allocated with new.");
+ Ins(&R, func.proto, "$Dname_Delete($Hdrtype &msg)", false);
+ Ins(&R, func.body, "switch($typefld) {");
+ ind_beg(amc::dispatch_c_dispatch_msg_curs, msg,disp) {
+ vrfy(msg.p_ctype->c_msgtype, tempstr()<<"amc.Disp_Delete ctype:"<c_msgtype->type.value);
+ Set(R, "$Msgname", StripNs("",ctype_Get(msg)));
+ Set(R, "$Ctype", amc::NsToCpp(ctype_Get(msg)));
+ Ins(&R, func.body, "case $Msgtype: delete $Ctype_Castdown(msg); break;");
+ }ind_end;
+ Ins(&R, func.body, "}");
+}
diff --git a/cpp/amc/disp/filter.cpp b/cpp/amc/disp/filter.cpp
index 3c8ec0be..d5527a9f 100644
--- a/cpp/amc/disp/filter.cpp
+++ b/cpp/amc/disp/filter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/amc/disp/kafka_decode.cpp b/cpp/amc/disp/kafka_decode.cpp
new file mode 100644
index 00000000..566dfb3d
--- /dev/null
+++ b/cpp/amc/disp/kafka_decode.cpp
@@ -0,0 +1,78 @@
+// Copyright (C) 2025-2026 AlgoRND
+//
+// License: GPL
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Target: amc (exe) -- Algo Model Compiler: generate code under include/gen and cpp/gen
+// Exceptions: NO
+// Source: cpp/amc/disp/kafka_decode.cpp
+//
+
+#include "include/amc.h"
+
+void amc::Disp_KafkaDecode(amc::FDispatch &disp) {
+ algo_lib::Replscope R;
+ R.strict=2;
+ Set(R, "$ns", ns_Get(disp));
+ Set(R, "$Hdrtype", amc::NsToCpp(disp.p_ctype_hdr->ctype));
+ Set(R, "$Dname", name_Get(disp));
+ amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$ns.$Dname..KafkaDecode"));
+ func.glob = true;
+ func.ret = "void";
+ Ins(&R, func.comment, "Decode kafka message to BUF.");
+ Ins(&R, func.proto, "$Dname_KafkaDecode()", false);
+ AddRetval(func, Subst(R,"$Hdrtype *"), "ret", "NULL");
+ AddProtoArg(func, Refto("algo::memptr"), "buf");
+ bool req = name_Get(*disp.p_ctype_hdr) == "RequestHeader";
+ if (req) {
+ Ins(&R, func.body , "algo::memptr peek(buf);");
+ Ins(&R, func.body , "i16 request_api_key, request_api_version;");
+ Ins(&R, func.body , "bool ok = lib_kafka::DecodeI16(peek,request_api_key) && lib_kafka::DecodeI16(peek,request_api_version);");
+ Ins(&R, func.body , "if (ok) {");
+ } else {
+ AddProtoArg(func, "i16", "request_api_key");
+ AddProtoArg(func, "i16", "request_api_version");
+ Ins(&R, func.body , "bool ok(true);");
+ }
+ AddProtoArg(func, Refto("algo::cstring"), "err");
+ Ins(&R, func.body, "switch(request_api_key) {");
+ ind_beg(amc::dispatch_c_dispatch_msg_curs, msg,disp) {
+ vrfy(msg.p_ctype->c_msgtype, tempstr()<<"amc.Disp_KafkaDecode ctype:"<c_msgtype->type.value);
+ Set(R, "$Msgname", StripNs("",ctype_Get(msg)));
+ Set(R, "$Ctype", amc::NsToCpp(ctype_Get(msg)));
+ Ins(&R, func.body, "case $Msgtype: {");
+ Ins(&R, func.body , "$Ctype &msg = *new $Ctype;");
+ Ins(&R, func.body , "ok = $Msgname_KafkaDecode(buf,msg,request_api_version);");
+ Ins(&R, func.body , "if (ok) {");
+ Ins(&R, func.body , "ret = &Castbase(msg);");
+ Ins(&R, func.body , "} else {");
+ Ins(&R, func.body , "err << \"$Dname_KafkaDecode(): Failed to decode $Msgname, decoded portion and rest bytes follow\" << eol;");
+ Ins(&R, func.body , "$Msgname_Print(msg,err);");
+ Ins(&R, func.body , "err << eol << \"rest bytes: \" << buf << eol;");
+ Ins(&R, func.body , "delete &msg;");
+ Ins(&R, func.body , "}");
+ Ins(&R, func.body , "} break;");
+ Ins(&R, func.body , "");
+ }ind_end;
+ //Ins(&R, func.body, "}");
+ Ins(&R, func.body , "default: {");
+ Ins(&R, func.body , "ok = false;");
+ Ins(&R, func.body , "err << \"$Dname_KafkaDecode(): bad API key \" << request_api_key << eol;");
+ Ins(&R, func.body , "} break;");
+ Ins(&R, func.body , "}");
+ if (req) {
+ Ins(&R, func.body , "}");
+ }
+}
diff --git a/cpp/amc/disp/kafka_encode.cpp b/cpp/amc/disp/kafka_encode.cpp
new file mode 100644
index 00000000..378d2494
--- /dev/null
+++ b/cpp/amc/disp/kafka_encode.cpp
@@ -0,0 +1,49 @@
+// Copyright (C) 2025-2026 AlgoRND
+//
+// License: GPL
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Target: amc (exe) -- Algo Model Compiler: generate code under include/gen and cpp/gen
+// Exceptions: NO
+// Source: cpp/amc/disp/kafka_encode.cpp
+//
+
+#include "include/amc.h"
+
+void amc::Disp_KafkaEncode(amc::FDispatch &disp) {
+ algo_lib::Replscope R;
+ R.strict=2;
+ Set(R, "$ns", ns_Get(disp));
+ Set(R, "$Hdrtype", amc::NsToCpp(disp.p_ctype_hdr->ctype));
+ Set(R, "$Dname", name_Get(disp));
+ Set(R, "$typefld", FieldvalExpr(disp.p_ctype_hdr, *disp.p_ctype_hdr->c_typefld->p_field, "msg"));
+
+ amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$ns.$Dname..KafkaEncode"));
+ func.glob = true;
+ func.ret = "void";
+ Ins(&R, func.comment, "Encode kafka message to BUF.");
+ Ins(&R, func.proto, "$Dname_KafkaEncode(algo::ByteAry &buf, $Hdrtype &msg)", false);
+ Ins(&R, func.body, "switch($typefld) {");
+ ind_beg(amc::dispatch_c_dispatch_msg_curs, msg,disp) {
+ vrfy(msg.p_ctype->c_msgtype, tempstr()<<"amc.Disp_KafkaEncode ctype:"<c_msgtype->type.value);
+ Set(R, "$Msgname", StripNs("",ctype_Get(msg)));
+ Set(R, "$Ctype", amc::NsToCpp(ctype_Get(msg)));
+ Ins(&R, func.body, "case $Msgtype: {");
+ Ins(&R, func.body, " $Msgname_KafkaEncode(buf,*$Ctype_Castdown(msg),msg.request_api_version);");
+ Ins(&R, func.body, "} break;");
+ Ins(&R, func.body, "");
+ }ind_end;
+ Ins(&R, func.body, "}");
+}
diff --git a/cpp/amc/disp/main.cpp b/cpp/amc/disp/main.cpp
index 7c961047..3ff078f8 100644
--- a/cpp/amc/disp/main.cpp
+++ b/cpp/amc/disp/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -42,6 +42,21 @@ void amc::gen_ns_dispatch() {
Disp_Read(disp);
}
}ind_end;
+ ind_beg(amc::ns_c_dispatch_curs, disp,ns) {
+ if (disp.dyn) {
+ Disp_Delete(disp);
+ }
+ }ind_end;
+ ind_beg(amc::ns_c_dispatch_curs, disp,ns) {
+ if (disp.kafka) {
+ Disp_KafkaEncode(disp);
+ }
+ }ind_end;
+ ind_beg(amc::ns_c_dispatch_curs, disp,ns) {
+ if (disp.kafka) {
+ Disp_KafkaDecode(disp);
+ }
+ }ind_end;
Filter_Gen(ns);
}
diff --git a/cpp/amc/disp/msg.cpp b/cpp/amc/disp/msg.cpp
index 24907bfa..f54286e5 100644
--- a/cpp/amc/disp/msg.cpp
+++ b/cpp/amc/disp/msg.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -39,6 +39,8 @@ void amc::Disp_CreateFromMsg() {
, false // haslen
, false // call
, false // strict
+ , typefld.p_field->p_ctype->c_ckafka // dyn
+ , typefld.p_field->p_ctype->c_ckafka // kafka
, typefld.p_ctype->comment));
(void)disp;
// loop over all messages that use this header...
diff --git a/cpp/amc/disp/print.cpp b/cpp/amc/disp/print.cpp
index 99b1bb3d..0b1840c3 100644
--- a/cpp/amc/disp/print.cpp
+++ b/cpp/amc/disp/print.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -28,6 +28,7 @@
// Generate Dispatch_Print function
void amc::Disp_Print(amc::FDispatch &disp) {
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$ns", ns_Get(disp));
Set(R, "$Hdrtype", amc::NsToCpp(disp.p_ctype_hdr->ctype));
Set(R, "$Dname", name_Get(disp));
diff --git a/cpp/amc/disp/read.cpp b/cpp/amc/disp/read.cpp
index ca0fe665..ea72b314 100644
--- a/cpp/amc/disp/read.cpp
+++ b/cpp/amc/disp/read.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -41,6 +41,7 @@ amc::FCfmt *amc::FindStringRead(amc::FCtype &ctype) {
// Generate Dispatch_Read function
void amc::Disp_Read(amc::FDispatch &disp) {
algo_lib::Replscope R;
+ R.strict=2;
Set(R, "$Dname", name_Get(disp));
Set(R, "$Disp", disp.dispatch);
Set(R, "$ns", ns_Get(disp));
@@ -49,12 +50,18 @@ void amc::Disp_Read(amc::FDispatch &disp) {
Set(R, "$Casetype", disp.p_casetype->cpp_type);
Set(R, "$casetypefld", strptr(name_Get(typefld)));
Set(R, "$caseenumprefix", (tempstr() << ns_Get(casetype) << "_"<< name_Get(casetype)));
+ Set(R, "$Hdrtype", disp.p_ctype_hdr ? amc::NsToCpp(disp.p_ctype_hdr->ctype) : tempstr());
amc::FFunc &func = amc::ind_func_GetOrCreate(Subst(R, "$Disp..ReadStrptr"));
func.ret = Subst(R,"$Casetype");
func.glob = true;
Ins(&R, func.comment, "Parse ascii representation of message into binary, appending new data to BUF.");
- Ins(&R, func.proto, "$Dname_ReadStrptr(algo::strptr str, algo::ByteAry &buf)", false);
+ if (disp.dyn) {
+ Ins(&R, func.proto, "$Dname_ReadStrptr(algo::strptr str, $Hdrtype **msg)", false);
+ Ins(&R, func.body , "*msg = NULL;");
+ } else {
+ Ins(&R, func.proto, "$Dname_ReadStrptr(algo::strptr str, algo::ByteAry &buf)", false);
+ }
Ins(&R, func.body , "bool ok = false;");
Ins(&R, func.body , "tempstr msgtype_str;");
Ins(&R, func.body , "algo::StringIter iter(str);");
@@ -80,24 +87,34 @@ void amc::Disp_Read(amc::FDispatch &disp) {
if (!cfmt) {
Ins(&R, func.body , " // no cfmt read:Y found -- cannot read");
} else if (cfmt->printfmt == dmmeta_Printfmt_printfmt_Tuple || cfmt->printfmt == dmmeta_Printfmt_printfmt_Extern) {
- Ins(&R, func.body , " int len = sizeof($Ctype);");
- Ins(&R, func.body , " $Ctype *ctype = new(ary_AllocN(buf, len).elems) $Ctype; // default values");
- if (is_varlen) {
- Ins(&R, func.body , " algo::ByteAry varlenbuf;");
- Ins(&R, func.body , " algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf;");
- Ins(&R, func.body , " algo_lib::_db.varlenbuf = &varlenbuf;");
- }
- Ins(&R, func.body , " ok = $Msgname_ReadStrptrMaybe(*ctype, str); // now read attributes");
- if (is_varlen) {
- Ins(&R, func.body , " len += ary_N(varlenbuf);");
- }
- if (is_varlen && lenfld) {// for non-varlen, length is already valid
- Set(R, "$assignlen", AssignExpr(*lenfld->p_field, "*ctype", lenassign, true));
- Ins(&R, func.body , " $assignlen;");
- }
- if (is_varlen) {
- Ins(&R, func.body , " ary_Addary(buf, ary_Getary(varlenbuf));");
- Ins(&R, func.body , " algo_lib::_db.varlenbuf = varlenbuf_save;");
+ if (disp.dyn) {
+ Ins(&R, func.body , " $Ctype *ctype = new $Ctype; // default values");
+ Ins(&R, func.body , " ok = $Msgname_ReadStrptrMaybe(*ctype, str); // now read attributes");
+ Ins(&R, func.body , " if (ok) {");
+ Ins(&R, func.body , " *msg = &Castbase(*ctype);");
+ Ins(&R, func.body , " } else {");
+ Ins(&R, func.body , " delete ctype;");
+ Ins(&R, func.body , " }");
+ } else {
+ Ins(&R, func.body , " int len = sizeof($Ctype);");
+ Ins(&R, func.body , " $Ctype *ctype = new(ary_AllocN(buf, len).elems) $Ctype; // default values");
+ if (is_varlen) {
+ Ins(&R, func.body , " algo::ByteAry varlenbuf;");
+ Ins(&R, func.body , " algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf;");
+ Ins(&R, func.body , " algo_lib::_db.varlenbuf = &varlenbuf;");
+ }
+ Ins(&R, func.body , " ok = $Msgname_ReadStrptrMaybe(*ctype, str); // now read attributes");
+ if (is_varlen) {
+ Ins(&R, func.body , " len += ary_N(varlenbuf);");
+ }
+ if (is_varlen && lenfld) {// for non-varlen, length is already valid
+ Set(R, "$assignlen", AssignExpr(*lenfld->p_field, "*ctype", lenassign, true));
+ Ins(&R, func.body , " $assignlen;");
+ }
+ if (is_varlen) {
+ Ins(&R, func.body , " ary_Addary(buf, ary_Getary(varlenbuf));");
+ Ins(&R, func.body , " algo_lib::_db.varlenbuf = varlenbuf_save;");
+ }
}
} else {
prerr("amc.bad_dispatch_read"
@@ -110,7 +127,9 @@ void amc::Disp_Read(amc::FDispatch &disp) {
}ind_end;
Ins(&R, func.body , "default: break;");
Ins(&R, func.body , "}");
- MaybeUnused(func,"buf");
+ if (!disp.dyn) {
+ MaybeUnused(func,"buf");
+ }
Ins(&R, func.body , "return ok ? msgtype : $Casetype();");
//---
@@ -118,7 +137,12 @@ void amc::Disp_Read(amc::FDispatch &disp) {
read.ret = Subst(R,"bool");
read.glob = true;
Ins(&R, read.comment, "Parse ascii representation of message into binary, appending new data to BUF.");
- Ins(&R, read.proto, "$Dname_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf)", false);
- Ins(&R, read.body , "$Casetype msgtype = $Dname_ReadStrptr(str,buf);");
+ if (disp.dyn) {
+ Ins(&R, read.proto, "$Dname_ReadStrptrMaybe(algo::strptr str, $Hdrtype **msg)", false);
+ Ins(&R, read.body , "$Casetype msgtype = $Dname_ReadStrptr(str,msg);");
+ } else {
+ Ins(&R, read.proto, "$Dname_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf)", false);
+ Ins(&R, read.body , "$Casetype msgtype = $Dname_ReadStrptr(str,buf);");
+ }
Ins(&R, read.body , "return !(msgtype == $Casetype());");
}
diff --git a/cpp/amc/enum.cpp b/cpp/amc/enum.cpp
index 9cbd0654..8f677ecc 100644
--- a/cpp/amc/enum.cpp
+++ b/cpp/amc/enum.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
//
diff --git a/cpp/amc/exec.cpp b/cpp/amc/exec.cpp
index 1deafa4a..16b32ca4 100644
--- a/cpp/amc/exec.cpp
+++ b/cpp/amc/exec.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -95,7 +95,7 @@ void amc::tfunc_Exec_Kill() {
amc::FFunc& kill = amc::CreateCurFunc();
Ins(&R, kill.ret , "void",false);
Ins(&R, kill.proto, "$name_Kill($Parent)",false);
- Ins(&R, kill.body, "if ($_pid != 0) {");
+ Ins(&R, kill.body, "if ($_pid > 0) {");
Ins(&R, kill.body, " kill($_pid,9);");
Ins(&R, kill.body, " $name_Wait($pararg);");
Ins(&R, kill.body, "}");
diff --git a/cpp/amc/fast.cpp b/cpp/amc/fast.cpp
index 722a4d2e..9ad6ddc5 100644
--- a/cpp/amc/fast.cpp
+++ b/cpp/amc/fast.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2024 AlgoRND
+// Copyright (C) 2024-2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
diff --git a/cpp/amc/fbuf.cpp b/cpp/amc/fbuf.cpp
index d9d2d5f4..a2f2a3f6 100644
--- a/cpp/amc/fbuf.cpp
+++ b/cpp/amc/fbuf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2014-2019 NYSE | Intercontinental Exchange
//
@@ -27,8 +27,9 @@
static bool ReadQ(amc::FFbuf &fbuf) {
return fbufdir_Get(fbuf) == dmmeta_Fbufdir_fbufdir_in;
}
+
static bool HasFdQ(amc::FFbuf &fbuf) {
- return fbuf.insready != "" && fbuf.insready != fbuf.field;
+ return fbuf.iotype != amc::dmmeta_fbufiotype_nofd;
}
//
@@ -38,13 +39,25 @@ void amc::tclass_Fbuf() {
algo_lib::Replscope &R = amc::_db.genctx.R;
amc::FField &field = *amc::_db.genctx.p_field;
amc::FNs &ns = *amc::_db.genctx.p_field->p_ctype->p_ns;
-
- Set(R, "$dflt" , field.dflt.value);
- Set(R, "$ns" , ns.ns);
-
(void)ns;
vrfy(field.c_fbuf, tempstr()<<"fbuf record required for field "<c_lenfld, tempstr()<<"Msgbuf requires a type with lenfld. field: "< 0, "Linebuf requires dflt (end of line value)");
- Set(R, "$bufsize", tempstr()<"));
// how to force the elems to go to the end of of the struct?
- if (fbuf.max == 0) {
- InsVar(R, field.p_ctype , "u8*", "$name_elems", "NULL", "pointer to elements of indirect array");
- InsVar(R, field.p_ctype , "u32", "$name_max", "0", "current length of allocated array");
- } else {
- InsVar(R, field.p_ctype , "u8", "$name_elems[$bufsize]", "", "pointer to elements of inline array");
- }
+ InsVar(R, field.p_ctype , "u8*", "$name_elems", "NULL", "pointer to elements of indirect array");
+ InsVar(R, field.p_ctype , "u32", "$name_max", "0", "current length of allocated array");
InsVar(R, field.p_ctype , "i32", "$name_start", "", "beginning of valid bytes (in bytes)");
InsVar(R, field.p_ctype , "i32", "$name_end", "", "end of valid bytes (in bytes)");
- InsVar(R, field.p_ctype , "bool", "$name_eof", "", "no more data will be written to buffer");
- InsVar(R, field.p_ctype , "algo::Errcode", "$name_err", "", "system error code");
- InsVar(R, field.p_ctype , "bool", "$name_msgvalid", "", "current message is valid");
InsVar(R, field.p_ctype , "i32", "$name_msglen", "", "current message length");
- if (ReadQ(fbuf) && HasFdQ(fbuf)) {
- InsVar(R, field.p_ctype, "algo_lib::FIohook", "$name_iohook", "", "edge-triggered hook for refilling buffer");
+ InsVar(R, field.p_ctype , "algo::Errcode", "$name_err", "", "system error code");
+ if (HasFdQ(fbuf) && field.c_fbuf->iotype == dmmeta_fbufiotype_openssl) {
+ InsVar(R, field.p_ctype, "SSL*", "$name_ssl", "", "TLS connection");
+ }
+ if (HasFdQ(fbuf)) {
+ InsVar(R, field.p_ctype, "algo_lib::FIohook", "$name_iohook", "", "edge-triggered hook for the buffer");
}
if (ReadQ(fbuf) == false && HasFdQ(fbuf)) {
- InsVar(R, field.p_ctype, "algo_lib::FIohook", "$name_iohook", "", "edge-triggered hook for emptying buffer");
- InsVar(R, field.p_ctype, "bool", "$name_zerocopy", "", "support zero-copy optimization");
InsVar(R, field.p_ctype, "u64", "$name_n_eagain", "", "eagain counter");
}
+ if (field.do_trace) {
+ if (ReadQ(fbuf)) {
+ InsVar(R, field.p_ctype, "u64", "$name_n_read_byte", "", "read bytes");
+ InsVar(R, field.p_ctype, "u64", "$name_n_read_msg", "", "read bytes");
+ } else {
+ InsVar(R, field.p_ctype, "u64", "$name_n_write_byte", "", "written bytes");
+ InsVar(R, field.p_ctype, "u64", "$name_n_write_msg", "", "written messages");
+ }
+ }
+ InsVar(R, field.p_ctype , "bool", "$name_eof", "", "no more data will be written to buffer");
+ InsVar(R, field.p_ctype , "bool", "$name_msgvalid", "", "current message is valid");
InsVar(R, field.p_ctype , "bool", "$name_epoll_enable", "", "use epoll?");
- if (fbuf.max > 0) {
- InsStruct(R, field.p_ctype , "enum { $name_max = $bufsize };");
+ if (ReadQ(fbuf) == false && HasFdQ(fbuf)) {
+ InsVar(R, field.p_ctype, "bool", "$name_zerocopy", "", "support zero-copy optimization");
}
Set(R, "$ready", name_Get(*fbuf.p_insready));
@@ -102,18 +120,22 @@ void amc::tfunc_Fbuf_BeginRead() {
amc::FFunc& func = amc::CreateCurFunc();
Ins(&R, func.comment, "Attach file descriptor and begin reading using edge-triggered epoll.");
Ins(&R, func.comment, "File descriptor becomes owned by $Partype.$name via FIohook field.");
- Ins(&R, func.comment, "Whenever the file descriptor becomes readable, insert $parname into $ready.");
+ if (fbuf.insready != "") {
+ Ins(&R, func.comment, "Whenever the file descriptor becomes readable, insert $parname into $ready.");
+ }
Ins(&R, func.proto, "$name_BeginRead($Parent, algo::Fildes fd)",false);
Ins(&R, func.ret , "void",false);
- Ins(&R, func.body, "callback_Set1($parname.$name_iohook, $parname, $ns::$ready_Insert);");
Ins(&R, func.body, "$parname.$name_iohook.fildes = fd;");
- Ins(&R, func.body, "IOEvtFlags flags;");
- Ins(&R, func.body, "read_Set(flags, true);");
- Ins(&R, func.body, "if ($pararg.$name_epoll_enable) {");
- Ins(&R, func.body, " algo_lib::IohookAdd($parname.$name_iohook, flags);");
- Ins(&R, func.body, "} else {");
- Ins(&R, func.body, " $ns::$ready_Insert($pararg);");
- Ins(&R, func.body, "}");
+ if (fbuf.insready != "") {
+ Ins(&R, func.body, "callback_Set1($parname.$name_iohook, $parname, $ns::$ready_Insert);");
+ Ins(&R, func.body, "IOEvtFlags flags;");
+ Ins(&R, func.body, "read_Set(flags, true);");
+ Ins(&R, func.body, "if ($pararg.$name_epoll_enable) {");
+ Ins(&R, func.body, " algo_lib::IohookAdd($parname.$name_iohook, flags);");
+ Ins(&R, func.body, "} else {");
+ Ins(&R, func.body, " $ns::$ready_Insert($pararg);");
+ Ins(&R, func.body, "}");
+ }
}
}
@@ -169,7 +191,7 @@ void amc::tfunc_Fbuf_GetMsg() {
} else if (msgbuf) {
Ins(&R, getmsg.body, "ret = $parname.$name_msgvalid ? hdr : NULL;");
}
- if (fbuf.inseof != fbuf.field) {
+ if (fbuf.inseof != "") {
Ins(&R, getmsg.body, "if (!$parname.$name_msgvalid && $parname.$name_eof) { // all messages processed");
Ins(&R, getmsg.body, " $ns::$eof_Insert($pararg);");
Ins(&R, getmsg.body, "}");
@@ -185,10 +207,8 @@ void amc::tfunc_Fbuf_Init() {
amc::FFunc& init = amc::CreateCurFunc();
init.inl = false;
- if (fbuf.max == 0) {
- Ins(&R, init.body , "$parname.$name_elems = NULL; // $name: initialize");
- Ins(&R, init.body , "$parname.$name_max = 0; // $name: initialize");
- }
+ Ins(&R, init.body , "$parname.$name_elems = NULL; // $name: initialize");
+ Ins(&R, init.body , "$parname.$name_max = 0; // $name: initialize");
Ins(&R, init.body , "$parname.$name_end = 0; // $name: initialize");
Ins(&R, init.body , "$parname.$name_start = 0; // $name: initialize");
Ins(&R, init.body , "$parname.$name_eof = false; // $name: initialize");
@@ -199,21 +219,30 @@ void amc::tfunc_Fbuf_Init() {
Ins(&R, init.body, "$parname.$name_msgvalid = false; // $name: initialize");
Ins(&R, init.body, "$parname.$name_msglen = 0; // $name: initialize");
Ins(&R, init.body, "$parname.$name_epoll_enable = true; // $name: initialize");
+ if (HasFdQ(fbuf) && field.c_fbuf->iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, init.body, "$parname.$name_ssl = NULL; // $name: initialize");
+ }
+ // initialize buffer
+ Set(R,"$fbufmax",tempstr()< 0);");
- Ins(&R, refill.body , " $parname.$name_end += i32_Max(ret,0); // new end of bytes");
- Ins(&R, refill.body , " if (error) {");
- Ins(&R, refill.body , " $parname.$name_err = algo::FromErrno(errno); // fetch errno");
- Ins(&R, refill.body , " }");
- Ins(&R, refill.body , " $parname.$name_eof |= eof;");
- Ins(&R, refill.body , "}");
- Ins(&R, refill.body , "if (!readable && $pararg.$name_epoll_enable) {");
- Ins(&R, refill.body , " $ns::$ready_Remove($pararg);");
+ if (fbuf.iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, refill.body, " if ($parname.$name_ssl) {");
+ Ins(&R, refill.body, " int ret = SSL_read($parname.$name_ssl,$parname.$name_elems + end, nfree);");
+ Ins(&R, refill.body, " int err = SSL_get_error($parname.$name_ssl,ret);");
+ Ins(&R, refill.body, " bool fdretry = err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE;");
+ Ins(&R, refill.body, " bool sslretry = fdretry || err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_X509_LOOKUP;");
+ Ins(&R, refill.body, " bool zero = err == SSL_ERROR_ZERO_RETURN;");
+ Ins(&R, refill.body, " readable = !fdretry;");
+ Ins(&R, refill.body, " bool error = err && !sslretry;");
+ Ins(&R, refill.body, " bool eof = error || zero;");
+ Ins(&R, refill.body, " $parname.$name_end += i32_Max(ret,0); // new end of bytes");
+ Ins(&R, refill.body, " if (error) {");
+ Ins(&R, refill.body, " $parname.$name_err = algo::MakeErrcode(algo_Errns_ssl, err);");
+ Ins(&R, refill.body, " }");
+ Ins(&R, refill.body, " $parname.$name_eof |= eof;");
+ Ins(&R, refill.body, " } else {");
+ } {
+ Ins(&R, refill.body, " ssize_t ret = read(fd, $parname.$name_elems + end, nfree);");
+ Ins(&R, refill.body, " readable = !(ret < 0 && errno == EAGAIN);");
+ Ins(&R, refill.body, " bool error = ret < 0 && errno != EAGAIN; // detect permanent error on this fd");
+ Ins(&R, refill.body, " bool eof = error || (ret == 0 && nfree > 0);");
+ Ins(&R, refill.body, " $parname.$name_end += i32_Max(ret,0); // new end of bytes");
+ Ins(&R, refill.body, " if (error) {");
+ Ins(&R, refill.body, " $parname.$name_err = algo::FromErrno(errno); // fetch errno");
+ Ins(&R, refill.body, " }");
+ Ins(&R, refill.body, " $parname.$name_eof |= eof;");
+ }
+ if (fbuf.iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, refill.body, " }"); // ssl else
+ }
Ins(&R, refill.body , "}");
+ if (fbuf.insready != "") {
+ Ins(&R, refill.body , "if (!readable && $pararg.$name_epoll_enable) {");
+ Ins(&R, refill.body , " $ns::$ready_Remove($pararg);");
+ Ins(&R, refill.body , "}");
+ }
Ins(&R, refill.body , "return readable;");
}
}
@@ -289,6 +340,7 @@ void amc::tfunc_Fbuf_ScanMsg() {
Ins(&R, scanmsg.ret , "void",false);
Ins(&R, scanmsg.proto, "$name_ScanMsg($Parent)",false);
if (bytebuf_extern) {
+ scanmsg.acrkey << "fbuf:"<= 0) {");
- Ins(&R, writeall.body, " in += rc;");
- Ins(&R, writeall.body, " in_n -= rc;");
+ Ins(&R, writeall.body, " if ($parname.$name_zerocopy && out_N($pararg)==0) {// in kernel bypass situations this is faster");
+ if (fbuf.iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, writeall.body, " int rc = $pararg.out_ssl ? SSL_write($pararg.out_ssl, in, in_n)");
+ Ins(&R, writeall.body, " : write($pararg.out_iohook.fildes.value, in, in_n);");
+ } else {
+ Ins(&R, writeall.body, " int rc = write($pararg.out_iohook.fildes.value, in, in_n);");
+ }
+ Ins(&R, writeall.body, " if (rc >= 0) {");
+ Ins(&R, writeall.body, " in += rc;");
+ Ins(&R, writeall.body, " in_n -= rc;");
+ Ins(&R, writeall.body, " }");
Ins(&R, writeall.body, " }");
- Ins(&R, writeall.body, "}");
}
- Ins(&R, writeall.body , "if (fits && in_n > 0) {");
- Ins(&R, writeall.body , " memcpy($parname.$name_elems + end, in, in_n);");
- Ins(&R, writeall.body , " $parname.$name_end = end + in_n;");
- if (ReadQ(fbuf) == false && HasFdQ(fbuf)) {
- Ins(&R, writeall.body, " $ready_Insert($pararg); // schedule outflow");
+ Ins(&R, writeall.body , " if (in_n > 0) {");
+ Ins(&R, writeall.body , " memcpy($parname.$name_elems + end, in, in_n);");
+ Ins(&R, writeall.body , " $parname.$name_end = end + in_n;");
+ if (ReadQ(fbuf) == false && HasFdQ(fbuf) && fbuf.insready != "") {
+ Ins(&R, writeall.body, " $ready_Insert($pararg); // schedule outflow");
}
- Ins(&R, writeall.body , "}");
+ Ins(&R, writeall.body , " }");
+ Ins(&R, writeall.body, " }");
Ins(&R, writeall.body , "return fits;");
}
@@ -465,21 +557,25 @@ void amc::tfunc_Fbuf_BeginWrite() {
if (ReadQ(fbuf) == false && HasFdQ(fbuf)) {
amc::FFunc& func = amc::CreateCurFunc();
Ins(&R, func.comment, "Attach file descriptor and begin outflowing buffer reading using edge-triggered epoll.");
- Ins(&R, func.comment, "Whenever buffer is non-empty and fd is writable, insert $parname into $ready.");
+ if (fbuf.insready != "") {
+ Ins(&R, func.comment, "Whenever buffer is non-empty and fd is writable, insert $parname into $ready.");
+ }
Ins(&R, func.comment, "User should implement a step function that calls $name_Outflow.");
Ins(&R, func.proto, "$name_BeginWrite($Parent, algo::Fildes fd, bool nodelete)",false);
Ins(&R, func.ret , "void",false);
Ins(&R, func.body, "callback_Set1($parname.$name_iohook, $parname, $ns::$ready_Insert);");
- Ins(&R, func.body, "$parname.$name_iohook.fildes = fd;");
Ins(&R, func.body, "if (nodelete) {");
Ins(&R, func.body, " $parname.$name_epoll_enable = false; // cannot register fd twice -- disable epoll on shared fd");
Ins(&R, func.body, " $parname.$name_iohook.nodelete = true;");
Ins(&R, func.body, "}");
- Ins(&R, func.body, "IOEvtFlags flags;");
- Ins(&R, func.body, "write_Set(flags, true);");
- Ins(&R, func.body, "if ($parname.$name_epoll_enable) {");
- Ins(&R, func.body, " algo_lib::IohookAdd($parname.$name_iohook, flags);");
- Ins(&R, func.body, "}");
+ if (fbuf.insready != "") {
+ Ins(&R, func.body, "$parname.$name_iohook.fildes = fd;");
+ Ins(&R, func.body, "IOEvtFlags flags;");
+ Ins(&R, func.body, "write_Set(flags, true);");
+ Ins(&R, func.body, "if ($parname.$name_epoll_enable) {");
+ Ins(&R, func.body, " algo_lib::IohookAdd($parname.$name_iohook, flags);");
+ Ins(&R, func.body, "}");
+ }
}
}
@@ -491,26 +587,55 @@ void amc::tfunc_Fbuf_Outflow() {
if (!ReadQ(fbuf) && HasFdQ(fbuf)) {
amc::FFunc& func = amc::CreateCurFunc();
- Ins(&R, func.comment, "Once all bytes are written or when fd buffer is full, buffer is automatically removed from $ready list.");
- Ins(&R, func.comment, "Edge-triggered epoll will re-insert $name into $ready.");
+ if (fbuf.insready != "") {
+ Ins(&R, func.comment, "Once all bytes are written or when fd buffer is full, buffer is automatically removed from $ready list.");
+ Ins(&R, func.comment, "Edge-triggered epoll will re-insert $name into $ready.");
+ }
Ins(&R, func.proto, "$name_Outflow($Parent)",false);
Ins(&R, func.ret , "bool",false);
Ins(&R, func.body , "int nwrite = $name_N($pararg);");
Ins(&R, func.body , "int start = $pararg.$name_start;");
- Ins(&R, func.body , "int nwritten = nwrite > 0 ? write($pararg.$name_iohook.fildes.value, $pararg.$name_elems + start, nwrite) : 0;");
- Ins(&R, func.body , "bool good = nwritten >= 0 || errno == EAGAIN;");
- if (field.do_trace) {
- Ins(&R, func.body , "if(errno == EAGAIN) {");
- Ins(&R, func.body , " $ns::_db.trace.$partrace_$name_n_eagain++;");
- Ins(&R, func.body , " $pararg.$name_n_eagain++;");
+ Ins(&R, func.body , "int nwritten;");
+ if (fbuf.iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, func.body, "if ($pararg.$name_ssl) {");
+ Ins(&R, func.body, " nwritten = SSL_write($pararg.$name_ssl, $pararg.$name_elems + start, nwrite);");
+ Ins(&R, func.body, " int err = SSL_get_error($pararg.$name_ssl,nwritten);");
+ Ins(&R, func.body, " bool fdretry = err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE;");
+ Ins(&R, func.body, " bool sslretry = fdretry || err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_X509_LOOKUP;");
+ Ins(&R, func.body, " bool good = nwritten >= 0 || sslretry;");
+ Ins(&R, func.body, " nwritten = i32_Max(nwritten,0);");
+ if (field.do_trace) {
+ Ins(&R, func.body, " if (fdretry) {");
+ Ins(&R, func.body, " $ns::_db.trace.$partrace_$name_n_eagain++;");
+ Ins(&R, func.body, " $pararg.$name_n_eagain++;");
+ Ins(&R, func.body, " }");
+ }
+ Ins(&R, func.body, "if (!good) {");
+ Ins(&R, func.body, " $pararg.$name_err = algo::MakeErrcode(algo_Errns_ssl, err); // save error code");
+ if (fbuf.inseof != "") {
+ Ins(&R, func.body, " $ns::$eof_Insert($pararg); // the end");
+ }
+ Ins(&R, func.body, "}");
+ Ins(&R, func.body, "} else {");
+ } {
+ Ins(&R, func.body , "nwritten = nwrite > 0 ? write($pararg.$name_iohook.fildes.value, $pararg.$name_elems + start, nwrite) : 0;");
+ Ins(&R, func.body , "bool good = nwritten >= 0 || errno == EAGAIN;");
+ if (field.do_trace) {
+ Ins(&R, func.body, "if(nwritten < 0 && errno == EAGAIN) {");
+ Ins(&R, func.body, " $ns::_db.trace.$partrace_$name_n_eagain++;");
+ Ins(&R, func.body, " $pararg.$name_n_eagain++;");
+ Ins(&R, func.body, "}");
+ }
+ Ins(&R, func.body , "if (!good) {");
+ Ins(&R, func.body , " $pararg.$name_err = algo::FromErrno(errno); // save error code");
+ if (fbuf.inseof != "") {
+ Ins(&R, func.body, " $ns::$eof_Insert($pararg); // the end");
+ }
Ins(&R, func.body , "}");
}
- Ins(&R, func.body , "if (!good) {");
- Ins(&R, func.body , " $pararg.$name_err = algo::FromErrno(errno); // save error code");
- if (fbuf.inseof != fbuf.field) {
- Ins(&R, func.body, " $ns::$eof_Insert($pararg); // the end");
+ if (fbuf.iotype == dmmeta_fbufiotype_openssl) {
+ Ins(&R, func.body, "}");
}
- Ins(&R, func.body , "}");
Ins(&R, func.body , "if (nwritten > 0) {");
Ins(&R, func.body , " $name_SkipBytes($pararg,nwritten); // skip written bytes");
Ins(&R, func.body , "}");
@@ -518,9 +643,11 @@ void amc::tfunc_Fbuf_Outflow() {
Ins(&R, func.body , "if ($pararg.$name_epoll_enable) {");
Ins(&R, func.body , " done |= nwritten<0;");
Ins(&R, func.body , "}");
- Ins(&R, func.body , "if (done) {");
- Ins(&R, func.body , " $ns::$ready_Remove($pararg); // done writing");
- Ins(&R, func.body , "}");
+ if (fbuf.insready != "") {
+ Ins(&R, func.body , "if (done) {");
+ Ins(&R, func.body , " $ns::$ready_Remove($pararg); // done writing");
+ Ins(&R, func.body , "}");
+ }
Ins(&R, func.body , "return nwritten > 0;");
}
}
@@ -536,7 +663,9 @@ void amc::tfunc_Fbuf_EndRead() {
Ins(&R, func.ret , "void",false);
Ins(&R, func.body, "if (ValidQ($parname.$name_iohook.fildes)) {");
Ins(&R, func.body, " $parname.$name_eof = true;");
- Ins(&R, func.body, " $ns::$ready_Insert($pararg);");
+ if (fbuf.insready != "") {
+ Ins(&R, func.body, " $ns::$ready_Insert($pararg);");
+ }
Ins(&R, func.body, "}");
}
}
@@ -560,39 +689,29 @@ void amc::tfunc_Fbuf_EndWrite() {
void amc::tfunc_Fbuf_Realloc() {
algo_lib::Replscope &R = amc::_db.genctx.R;
- amc::FField &field = *amc::_db.genctx.p_field;
- amc::FFbuf &fbuf = *field.c_fbuf;
-
- if (fbuf.max==0) {
- amc::FFunc& func = amc::CreateCurFunc();
- Ins(&R, func.comment, "Unconditionally reallocate buffer to have size NEW_MAX");
- Ins(&R, func.comment, "If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost");
- Ins(&R, func.comment, "(best to call this before filling the buffer)");
- Ins(&R, func.proto, "$name_Realloc($Parent, int new_max)",false);
- Ins(&R, func.ret , "void",false);
- Ins(&R, func.body, "new_max = i32_Max(new_max, $parname.$name_end);");
- Ins(&R, func.body, "u8 *new_mem = $parname.$name_elems");
- Ins(&R, func.body, " ? (u8*)$basepool_ReallocMem($parname.$name_elems, $parname.$name_max, new_max)");
- Ins(&R, func.body, " : (u8*)$basepool_AllocMem(new_max);");
- Ins(&R, func.body, "if (UNLIKELY(!new_mem)) {");
- Ins(&R, func.body, " FatalErrorExit(\"$ns.fbuf_nomem field:$field comment:'out of memory'\");");
- Ins(&R, func.body, "}");
- Ins(&R, func.body, "$parname.$name_elems = new_mem;");
- Ins(&R, func.body, "$parname.$name_max = new_max;");
- }
+ amc::FFunc& func = amc::CreateCurFunc();
+ Ins(&R, func.comment, "Unconditionally reallocate buffer to have size NEW_MAX");
+ Ins(&R, func.comment, "If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost");
+ Ins(&R, func.comment, "(best to call this before filling the buffer)");
+ Ins(&R, func.proto, "$name_Realloc($Parent, int new_max)",false);
+ Ins(&R, func.ret , "void",false);
+ Ins(&R, func.body, "new_max = i32_Max(new_max, $parname.$name_end);");
+ Ins(&R, func.body, "u8 *new_mem = $parname.$name_elems");
+ Ins(&R, func.body, " ? (u8*)$basepool_ReallocMem($parname.$name_elems, $parname.$name_max, new_max)");
+ Ins(&R, func.body, " : (u8*)$basepool_AllocMem(new_max);");
+ Ins(&R, func.body, "if (UNLIKELY(!new_mem)) {");
+ Ins(&R, func.body, " FatalErrorExit(\"$ns.fbuf_nomem field:$field comment:'out of memory'\");");
+ Ins(&R, func.body, "}");
+ Ins(&R, func.body, "$parname.$name_elems = new_mem;");
+ Ins(&R, func.body, "$parname.$name_max = new_max;");
}
void amc::tfunc_Fbuf_Uninit() {
algo_lib::Replscope &R = amc::_db.genctx.R;
- amc::FField &field = *amc::_db.genctx.p_field;
- amc::FFbuf &fbuf = *field.c_fbuf;
-
- if (fbuf.max==0) {
- amc::FFunc& uninit = amc::CreateCurFunc();
- Ins(&R, uninit.body, "if ($parname.$name_elems) {");
- Ins(&R, uninit.body, " $basepool_FreeMem($parname.$name_elems, sizeof($Cpptype)*$parname.$name_max); // ($field)");
- Ins(&R, uninit.body, "}");
- Ins(&R, uninit.body, "$parname.$name_elems = NULL;");
- Ins(&R, uninit.body, "$parname.$name_max = 0;");
- }
+ amc::FFunc& uninit = amc::CreateCurFunc();
+ Ins(&R, uninit.body, "if ($parname.$name_elems) {");
+ Ins(&R, uninit.body, " $basepool_FreeMem($parname.$name_elems, sizeof($Cpptype)*$parname.$name_max); // ($field)");
+ Ins(&R, uninit.body, "}");
+ Ins(&R, uninit.body, "$parname.$name_elems = NULL;");
+ Ins(&R, uninit.body, "$parname.$name_max = 0;");
}
diff --git a/cpp/amc/fcast.cpp b/cpp/amc/fcast.cpp
index 658b3e27..a997f85e 100644
--- a/cpp/amc/fcast.cpp
+++ b/cpp/amc/fcast.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
diff --git a/cpp/amc/fcmap.cpp b/cpp/amc/fcmap.cpp
index 91f3b77b..d39fd26c 100644
--- a/cpp/amc/fcmap.cpp
+++ b/cpp/amc/fcmap.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2016-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/amc/fconst.cpp b/cpp/amc/fconst.cpp
index efab5cc5..3780bde0 100644
--- a/cpp/amc/fconst.cpp
+++ b/cpp/amc/fconst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
diff --git a/cpp/amc/fdec.cpp b/cpp/amc/fdec.cpp
index 49233b89..1ea61c34 100644
--- a/cpp/amc/fdec.cpp
+++ b/cpp/amc/fdec.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/field.cpp b/cpp/amc/field.cpp
index 890b4ae1..b7beb753 100644
--- a/cpp/amc/field.cpp
+++ b/cpp/amc/field.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -77,6 +77,7 @@ void amc::tfunc_Field_Cleanup() {
amc::FFunc& cleanup = amc::CreateCurFunc(true); {
AddRetval(cleanup, "void", "", "");
}
+ cleanup.acrkey << "fcleanup:"<cpp_type << "::";
}
}
+ if (proto_only) {
+ strptr ns = ns_Get(func);
+ if (ns !="") {
+ out << ns<<"::";
+ }
+ }
out << func.proto;
if (func.isconst) {
out <<"const ";
diff --git a/cpp/amc/fwddecl.cpp b/cpp/amc/fwddecl.cpp
index 06c6e707..c5cce1d4 100644
--- a/cpp/amc/fwddecl.cpp
+++ b/cpp/amc/fwddecl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -52,6 +52,10 @@ bool amc::FwdDeclQ(amc::FField &field) {
&& !field.p_arg->c_cextern
&& (field.reftype == dmmeta_Reftype_reftype_Fbuf
|| field.reftype == dmmeta_Reftype_reftype_Opt
+ || field.reftype == dmmeta_Reftype_reftype_Ptrary
+ || field.reftype == dmmeta_Reftype_reftype_Delptr
+ || field.reftype == dmmeta_Reftype_reftype_Upptr
+ || field.reftype == dmmeta_Reftype_reftype_Ptr
|| field.reftype == dmmeta_Reftype_reftype_Varlen
|| field.reftype == dmmeta_Reftype_reftype_Lary);
}
@@ -116,7 +120,7 @@ static void Fwddecl_GenStructNs(amc::FNs &ns) {
void amc::gen_ns_fwddecl2() {
ind_beg(amc::_db_ns_curs, ns, amc::_db) {
- if (ns.select) {
+ if (ns.c_nscpp) {
*ns.hdr << "// gen:ns_fwddecl2" << eol;
Fwddecl_GenStructNs(ns);
}
@@ -142,6 +146,7 @@ static void Hook_FwdDecl(amc::FField &field, amc::FGstatic &gstatic) {
}
}
func.comment<<"User-implemented function from gstatic:"<p_arg) {
- bool isxref = field.p_reftype->isxref;
- isxref |= (field.reftype == dmmeta_Reftype_reftype_Ptrary);
- isxref |= (field.reftype == dmmeta_Reftype_reftype_Ptr);
- isxref |= (field.reftype == dmmeta_Reftype_reftype_Hook);
- amc::FField *inst = amc::FirstInst(*field.p_arg);
- if (!isxref && inst && inst->c_finput) {
- amccheck(0,"amc.gstatic_uses_finput"
- <arg)
- <c_gstatic && gstatic.p_field->p_arg->topo_idx < inst->c_gstatic->p_field->p_arg->topo_idx) {
+ ind_beg(amc::_db_xref_curs, xref, amc::_db) {
+ amc::FField *parent = FirstInst(*xref.p_field->p_ctype);
+ amc::FField *child = FirstInst(*xref.p_field->p_arg);
+ if (xref.p_field->reftype == dmmeta_Reftype_reftype_Upptr) {
+ algo::TSwap(child,parent);
+ }
+ if (child && parent && child->c_gstatic && parent->c_gstatic) {
+ if (child->c_gstatic->rowid < parent->c_gstatic->rowid) {
amccheck(0,"amc.gstatic_dep"
- <arg)
- <arg)
+ <arg)
+ <c_gstatic && parent->c_finput) {
+ amccheck(0,"amc.gstatic_uses_finput"
+ <arg)
+ <arg)
+ <reftype)
+ <c_varlenfld == &field && !(field.reftype == dmmeta_Reftype_reftype_Varlen)) {
+ if (ctype_zd_varlenfld_InLlistQ(field) && !(field.reftype == dmmeta_Reftype_reftype_Varlen)) {
err = "Field reftype must be Varlen";
}
CheckReftype(field, dmmeta_Reftype_reftype_Hook, field.c_hook, dmmeta_Ssimfile_ssimfile_dmmeta_hook, err);
@@ -561,7 +559,7 @@ static bool NeedFirstchangedQ(amc::FField &field) {
// -----------------------------------------------------------------------------
void amc::gen_prep_field() {
- // other field stuff -- determine ctype, set c_varlenfld, etc.
+ // other field stuff -- determine ctype, set zd_varlenfld, etc.
ind_beg(amc::_db_field_curs, field,amc::_db) {
amc::FCtype& ctype = *field.p_ctype;
@@ -586,7 +584,7 @@ void amc::gen_prep_field() {
field.cpp_type = amc::NsToCpp(field.p_arg->ctype);
}
if (field.reftype == dmmeta_Reftype_reftype_Varlen) {
- amc::c_varlenfld_InsertMaybe(ctype,field);
+ amc::zd_varlenfld_Insert(ctype,field);
}
if (field.reftype == dmmeta_Reftype_reftype_Opt) {
amc::c_optfld_InsertMaybe(ctype,field);
@@ -783,7 +781,7 @@ void amc::gen_xref2() {
void amc::gen_select_ns() {
ind_beg(amc::_db_ns_curs, ns,amc::_db) {
- ns.select = ns.c_nscpp;
+ ns.select = ns.c_nscpp || ns.c_nsjs;
}ind_end;
}
@@ -855,7 +853,11 @@ void amc::gen_bitfldenum() {
fconst.fconst = tempstr() << srcfield.field << "/" << name_Get(*bitfld.p_field);
fconst.comment = algo::Comment(bitfld.field);
// cpp_type has not yet defined, assume cpp_type = ctype
- fconst.value = algo::CppExpr(tempstr() << "("<< srcfield.p_arg->ctype << "(1)<<" << bitfld.offset << ")");
+ // fconst.value = algo::CppExpr(tempstr() << "("<< srcfield.p_arg->ctype << "(1)<<" << bitfld.offset << ")");
+ // AP: needs to be compatible with js, do not use native c types
+ cstring value;
+ algo::u64_PrintHex(u64(1)<p_ctype->p_ns == ptrary.p_field->p_arg->p_ns
- ,tempstr()<<"amc.foreign_ptrary"
- <arg)
- );
- dmmeta::Field newfield;
- tempstr refname = amc::Refname(*ptrary.p_field->p_ctype);
- newfield.field = tempstr()<arg<<"."<p_ctype->p_ns == ptrary.p_field->p_arg->p_ns
+ ,tempstr()<<"amc.foreign_ptrary"
+ <arg)
+ );
+ dmmeta::Field newfield;
+ tempstr xf;
+ if (!GlobalQ(*ptrary.p_field->p_ctype)) {
+ xf << amc::Refname(*ptrary.p_field->p_ctype) << "_";
+ }
+ if (ptrary.heaplike) {
+ newfield.field = tempstr()<arg<<"."<arg<<"."<heaplike)
+ ||(field.c_llist && !field.c_llist->p_listtype->haveprev));
+}
+
void amc::gen_ns_check_path() {
amc::FNs &ns =*amc::_db.c_ns;
ind_beg(amc::ns_c_ctype_curs, ctype, ns) {
@@ -1155,21 +1178,22 @@ void amc::gen_ns_check_path() {
int ndel=0;
ind_beg(amc::ctype_zd_access_curs,access,ctype) {
ndel += access.p_reftype->del;
- if (access.c_xref) {// don't count raw ptrary
- nslow += access.reftype==dmmeta_Reftype_reftype_Ptrary;
- nslow += access.reftype==dmmeta_Reftype_reftype_Llist
- && access.c_llist && !access.c_llist->p_listtype->haveprev;
- }
+ nslow += SlowDelQ(access);
}ind_end;
bool good=ndel==0 || nslow<2;
amccheck(good
, "amc.many_slow_paths"
<del)
+ < n_hdr) {
+ *ns.hdr << eol;
+ }
+ }ind_end;
+ ind_beg(amc::ctype_c_ffunc_curs, ffunc, ctype) {
if (!ffunc.printed && !ffunc.ismacro && !ffunc.globns && !ffunc.disable) {
if (!ffunc.priv && !ffunc.member) {
tempstr proto;
- PrintFuncProto(ffunc,NULL,proto);// goes to header
+ PrintFuncProto(ffunc,NULL,proto,false);// goes to header
algo::InsertIndent(*ns.hdr, proto, 0);
}
- PrintFuncBody(ns,ffunc);// goes to source
+ if (!ffunc.extrn && !ffunc.deleted) {
+ PrintFuncBody(ns,ffunc);// goes to source
+ }
ffunc.printed=true;
}
}ind_end;
- if (ch_N(*ns.hdr) > n_hdr) {
- *ns.hdr << eol;
- }
- }ind_end;
- ind_beg(amc::ctype_c_ffunc_curs, ffunc, ctype) {
- if (!ffunc.printed && !ffunc.ismacro && !ffunc.globns && !ffunc.disable) {
- if (!ffunc.priv && !ffunc.member) {
- tempstr proto;
- PrintFuncProto(ffunc,NULL,proto);// goes to header
- algo::InsertIndent(*ns.hdr, proto, 0);
- }
- if (!ffunc.extrn && !ffunc.deleted) {
- PrintFuncBody(ns,ffunc);// goes to source
- }
- ffunc.printed=true;
- }
}ind_end;
- }ind_end;
- amc::EndNsBlock(*ns.hdr, ns, "");
+ amc::EndNsBlock(*ns.hdr, ns, "");
+ }
}
void amc::gen_ns_curstext() {
@@ -1305,36 +1333,38 @@ void amc::gen_ns_pnew() {
void amc::gen_ns_func() {
amc::FNs &ns =*amc::_db.c_ns;
- algo_lib::Replscope R;
- Set(R, "$ns", ns.ns);
- amc::BeginNsBlock(*ns.hdr, ns, "");
- ind_beg(amc::ns_c_func_curs, func,ns) {
- if (!func.printed && !func.ismacro && !func.disable && !func.member && !func.globns) {
- if (!func.priv) {
- tempstr proto;
- PrintFuncProto(func, NULL, proto);
- algo::InsertIndent(*ns.hdr, proto, 0);
- }
- if (!func.extrn && !func.deleted) {
- PrintFuncBody(ns, func);
- }
- func.printed = true;
- }
- }ind_end;
- amc::EndNsBlock(*ns.hdr, ns, "");
- ind_beg(amc::ns_c_func_curs, func,ns) {
- if (!func.printed && !func.ismacro && !func.disable && !func.member && func.globns) {
- if (!func.priv) {
- tempstr proto;
- PrintFuncProto(func, NULL, proto);
- algo::InsertIndent(*ns.hdr, proto, 0);
+ if (ns.c_nscpp) {
+ algo_lib::Replscope R;
+ Set(R, "$ns", ns.ns);
+ amc::BeginNsBlock(*ns.hdr, ns, "");
+ ind_beg(amc::ns_c_func_curs, func,ns) {
+ if (!func.printed && !func.ismacro && !func.disable && !func.member && !func.globns) {
+ if (!func.priv) {
+ tempstr proto;
+ PrintFuncProto(func, NULL, proto, false);
+ algo::InsertIndent(*ns.hdr, proto, 0);
+ }
+ if (!func.extrn && !func.deleted) {
+ PrintFuncBody(ns, func);
+ }
+ func.printed = true;
}
- if (!func.extrn && !func.deleted) {
- PrintFuncBody(ns, func);
+ }ind_end;
+ amc::EndNsBlock(*ns.hdr, ns, "");
+ ind_beg(amc::ns_c_func_curs, func,ns) {
+ if (!func.printed && !func.ismacro && !func.disable && !func.member && func.globns) {
+ if (!func.priv) {
+ tempstr proto;
+ PrintFuncProto(func, NULL, proto, false);
+ algo::InsertIndent(*ns.hdr, proto, 0);
+ }
+ if (!func.extrn && !func.deleted) {
+ PrintFuncBody(ns, func);
+ }
+ func.printed = true;
}
- func.printed = true;
- }
- }ind_end;
+ }ind_end;
+ }
}
// -----------------------------------------------------------------------------
@@ -1376,14 +1406,16 @@ static void GenOperators(algo_lib::Replscope &R, amc::FNs &ns, amc::FCtype &ctyp
void amc::gen_ns_operators() {
amc::FNs &ns =*amc::_db.c_ns;
- algo_lib::Replscope R;
- // generate "operator <<" for every print function...
- *ns.hdr<<"// gen:ns_operators" << eol;
- *ns.hdr << "namespace algo {" << eol;
- ind_beg(amc::ns_c_ctype_curs, ctype, ns) {
- GenOperators(R,ns,ctype);
- }ind_end;
- *ns.hdr << "}" << eol;
+ if (ns.c_nscpp) {
+ algo_lib::Replscope R;
+ // generate "operator <<" for every print function...
+ *ns.hdr<<"// gen:ns_operators" << eol;
+ *ns.hdr << "namespace algo {" << eol;
+ ind_beg(amc::ns_c_ctype_curs, ctype, ns) {
+ GenOperators(R,ns,ctype);
+ }ind_end;
+ *ns.hdr << "}" << eol;
+ }
}
// -----------------------------------------------------------------------------
@@ -1453,7 +1485,15 @@ void amc::gen_proc() {
void amc::gen_check_fcurs() {
ind_beg(_db_fcurs_curs,fcurs,_db) {
- tempstr key = amcdb::Tfunc_Concat_tclass_name(fcurs.p_field->reftype, curstype_Get(fcurs));
+ // A field can correspond to several template classes
+ // but that relationship is elucidated in the function GenTclass_Field
+ // and not known anywhere else; For existing cursors, the reftype alone is sufficient,
+ // plus Bitset tclass.
+ tempstr tclass(fcurs.p_field->reftype);
+ if (fcurs.p_field->c_fbitset) {
+ tclass=amc_tclass_Bitset.tclass;
+ }
+ tempstr key = amcdb::Tfunc_Concat_tclass_name(tclass, curstype_Get(fcurs));
amc::FTfunc *tfunc=ind_tfunc_Find(key);
if (!tfunc || !tfunc->c_tcurs) {
prlog("amc.cursory_examination"
@@ -1468,7 +1508,7 @@ void amc::gen_check_fcurs() {
void amc::gen_check_varlen() {
ind_beg(amc::_db_ctype_curs,ctype,amc::_db) {
// messages with Varlen etc cannot be cheap copy
- if ((ctype.c_varlenfld || ctype.c_optfld) && ctype.c_cpptype && ctype.c_cpptype->cheap_copy) {
+ if ((!zd_varlenfld_EmptyQ(ctype) || ctype.c_optfld) && ctype.c_cpptype && ctype.c_cpptype->cheap_copy) {
prlog("ams.a_little_too_cheap"
<p_ns;
if (ns.c_main) {
amc::FFunc& func = amc::CreateCurFunc(true);
+ func.acrkey << "main:"<
static tempstr GetCmdArgDflt(amc::FField &field) {
tempstr ret(field.dflt.value);
-
if (field.c_fflag) {
// no default for flags (even if they can take a value)
ret="";
- } if (field.c_tary) {
+ } else if (field.c_tary) {
// no default for arrays -- since they can be empty
ret="";
} else if (field.arg=="bool") {
@@ -911,9 +894,8 @@ void amc::tfunc_Global_ReadArgv() {
}
Ins(&R, func.body, " if (ch_N(attrname) == 0) {");
Ins(&R, func.body, " err << \"$ns: too many arguments. error at \"< 0;");
+ Ins(&R, func.body, "algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1;");
}
Ins(&R, func.body, "if (!dohelp) {");
@@ -997,7 +982,7 @@ void amc::tfunc_Global_ReadArgv() {
Ins(&R, func.body, "if (err != \"\") {");
Ins(&R, func.body, " algo_lib::_db.exit_code=1;");
- Ins(&R, func.body, " prerr(err);");
+ Ins(&R, func.body, " prerr_(err); // already has eol");
Ins(&R, func.body, " doexit=true;");
Ins(&R, func.body, "}");
diff --git a/cpp/amc/gsymbol.cpp b/cpp/amc/gsymbol.cpp
index 18d48ca2..7120936a 100644
--- a/cpp/amc/gsymbol.cpp
+++ b/cpp/amc/gsymbol.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2023 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -45,7 +45,7 @@ void amc::gen_ns_gsymbol() {
amc::_db.genctx.p_field = NULL;
ind_beg(amc::ns_c_gsymbol_curs, gsymbol,ns) {
algo_lib::Regx regx;
- (void)Regx_ReadSql(regx, tempstr() <<"%("<" << eol;
@@ -200,6 +202,8 @@ void amc::GenUsedNs() {
}ind_end;
// check that one exe doesn't use another exe (will break during linking, but not fatal for amc)
+ // #AL# this can be OK since we allow cross-namespace pointers
+#if 0
ind_beg(amc::_db_ns_curs, ns, amc::_db) {
ind_beg(amc::ns_c_cppincl_curs, usedns, ns) if (&usedns != &ns) {
if (usedns.nstype == dmmeta_Nstype_nstype_exe
@@ -216,6 +220,7 @@ void amc::GenUsedNs() {
}
}ind_end;
}ind_end;
+#endif
}
// -----------------------------------------------------------------------------
diff --git a/cpp/amc/inlary.cpp b/cpp/amc/inlary.cpp
index 837f05ea..616d7395 100644
--- a/cpp/amc/inlary.cpp
+++ b/cpp/amc/inlary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/io.cpp b/cpp/amc/io.cpp
index 0b7692d3..6e43ca2b 100644
--- a/cpp/amc/io.cpp
+++ b/cpp/amc/io.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -46,13 +46,14 @@ void amc::tfunc_Io_InputMaybe() {
// nonextern -> inputmaybe calls InsertMaybe
if (finput.extrn) {
if (!GenThrowQ(*field.p_ctype->p_ns)) {
+ input.acrkey << "finput:"<.
+//
+// Target: amc (exe) -- Algo Model Compiler: generate code under include/gen and cpp/gen
+// Exceptions: NO
+// Source: cpp/amc/js.cpp
+//
+
+#include "include/algo.h"
+#include "include/amc.h"
+
+// add separator if lhs is not empty
+void amc::MaybeSep(cstring &lhs, strptr sep DFLTVAL(", ")){
+ if (ch_N(lhs)) {
+ lhs << sep;
+ }
+}
+
+// whether ctype is js or ts
+bool amc::JsQ(amc::FCtype &ctype) {
+ return ctype.p_ns->c_nsjs
+ && (!ctype.p_ns->c_nsjs->gensel || ctype.c_jstype);
+}
+
+// whether ctype is ts
+bool amc::TsQ(amc::FCtype &ctype) {
+ return ctype.p_ns->c_nsjs
+ && ctype.p_ns->c_nsjs->typescript
+ && (!ctype.p_ns->c_nsjs->gensel || ctype.c_jstype);
+}
+
+// compute javascript class name
+tempstr amc::JsType(amc::FCtype &ctype) {
+ return tempstr()<c_cstr || field.arg == "js.String";
+}
+
+// only inline arrays of u8 and char are supported
+bool amc::JsInlaryQ(amc::FField &field) {
+ return (field.reftype == dmmeta_Reftype_reftype_Inlary
+ && (field.c_inlary->min == field.c_inlary->max)
+ && (field.arg == "char" || field.arg == "u8"));
+}
+
+bool amc::JsByteArrayQ(amc::FField &field) {
+ bool ret = (field.reftype == dmmeta_Reftype_reftype_Varlen
+ || field.reftype == dmmeta_Reftype_reftype_Opt)
+ && field.arg != "char";
+ return ret || JsInlaryQ(field);
+}
+
+bool amc::JsVarlenStringQ(amc::FField &field) {
+ return field.reftype == dmmeta_Reftype_reftype_Varlen && field.arg == "char";
+}
+
+tempstr amc::JsGetArg(amc::FField &field) {
+ tempstr arg;
+ if (field.reftype == dmmeta_Reftype_reftype_Base) {
+ // nothing
+ } else if (JsByteArrayQ(field)) {
+ arg = "Uint8Array";
+ } else if (JsBooleanQ(field)) {
+ arg = "boolean";
+ } else if (JsNumberQ(field.arg)) {
+ arg = "number";
+ } else if (JsBigintQ(field.arg)) {
+ arg = "bigint";
+ } else if (JsStringQ(field)) {
+ arg = "string";
+ } else {
+ arg = JsType(*field.p_arg);
+ }
+ return arg;
+}
+
+// json-serialized type for fields
+tempstr amc::JsJsonArg(amc::FField &field) {
+ tempstr arg = JsGetArg(field);
+ if (JsBigintQ(field.arg)) {
+ arg = "number";
+ } else if (!TsLocalTypeQ(field)) {
+ arg = "string";
+ }
+ return arg;
+}
+
+// explicit cast to javascript type
+tempstr amc::JsCastType(amc::FField &field) {
+ tempstr arg = JsGetArg(field);
+ tempstr ret;
+ if (arg == "bigint") {
+ ret = "BigInt";
+ } else if (arg == "number") {
+ ret = "Number";
+ } else if (arg == "boolean") {
+ ret = "Boolean";
+ } else if (arg == "string") {
+ ret = "String";
+ } else if (field.reftype == dmmeta_Reftype_reftype_Bitfld && field.c_bitfld) {
+ // - return ((this.value & 0b11111111000000000000000000000000) >>> 24);
+ // + return new Proctype((this.value & 0b11111111000000000000000000000000) >>> 24);
+ ret << "new "<c_cdflt) {
+ ret << JsCastType(field) << "(" << field.p_arg->c_cdflt->jsdflt << ")";
+ } else if (field.p_arg->c_cstr) {
+ ret = "\"\"";
+ } else {
+ ret = tempstr() << "new "<p_ns == field.p_arg->p_ns;
+}
+
+// add import statement for name if not already in place
+void amc::TsImportMaybe(amc::FField &field, strptr name) {
+ if (!TsLocalTypeQ(field)) {
+ auto &R = _db.genctx.R;
+ Set(R,"$symbol",name);
+ Set(R,"$fromns",field.p_arg->p_ns->ns);
+ tempstr import;
+ Ins(&R,import,"import { $symbol } from \"./$fromns_gen\"");
+ if (FindStr(field.p_ctype->p_ns->js.import,import)==-1) {
+ field.p_ctype->p_ns->js.import << import;
+ }
+ }
+}
+
+// Return a javscript expression evaluating NAME, which is of type CTYPE
+// to a number
+tempstr amc::JsGetnumExpr(amc::FCtype &ctype, algo::strptr name) {
+ tempstr ret;
+ if (JsNumberQ(ctype.ctype)) {
+ ret = name;
+ } else {
+ ind_beg(ctype_c_field_curs,field,ctype) {
+ ret << name << "." << name_Get(field);
+ }ind_end;
+ }
+ return ret;
+}
+
+void amc::JsGenBitfld() {
+ auto &field = *_db.genctx.p_field;
+ auto &R = _db.genctx.R;
+ cstring &cls = field.p_ctype->js.body;
+ cstring bitmask("0b");
+ char_PrintNTimes('1',bitmask,field.c_bitfld->width);
+ char_PrintNTimes('0',bitmask,field.c_bitfld->offset);
+ Set(R,"$srcname",name_Get(*field.c_bitfld->p_srcfield));
+ Set(R,"$bitoffset",tempstr()<offset);
+ Set(R,"$bitmask",bitmask);
+ Ins(&R,cls,"$comment");
+ Ins(&R,cls,"get $name(): $arg {");
+ Ins(&R,cls," return $cast((this.$srcname & $bitmask) >>> $bitoffset);");
+ Ins(&R,cls,"}");
+ Ins(&R,cls,"set $name(x: number) {");
+ Ins(&R,cls," this.$srcname ^= $bitmask & this.$srcname");
+ Ins(&R,cls," this.$srcname |= (+x << $bitoffset) & $bitmask;");
+ Ins(&R,cls,"}");
+}
+
+void amc::TsGenEnum() {
+ auto &field = *_db.genctx.p_field;
+ auto &R = _db.genctx.R;
+ cstring &out = _db.genctx.p_ns->js.body;
+ Ins(&R,out,"");
+ if (field.c_anonfld) {
+ Ins(&R,out,"export enum $jstypeEnum {");
+ } else {
+ Ins(&R,out,"export enum $jstype_$name_Enum {");
+ }
+ ind_beg(field_c_fconst_curs,fconst,field) {
+ tempstr fcname(strptr_ToCppIdent(name_Get(fconst),true));
+ Set(R,"$fcname",fcname);
+ Set(R,"$value",tempstr()<c_msgtype ? (!field.c_typefld && !field.c_lenfld) : true) {
+ if (TsQ(*field.p_ctype)) {
+ MaybeSep(field.p_ctype->js.args);
+ Ins(&R,field.p_ctype->js.args,"$name?: $arg",false);
+ Ins(&R,field.p_ctype->js.body,"$name: $arg;$comment");
+ Ins(&R,field.p_ctype->js.ctor,"this.$name = typeof $name != 'undefined' ? $name : $dflt;");
+ TsImportMaybe(field,JsGetArg(field));
+ } else {
+ Ins(&R,field.p_ctype->js.ctor,"this.$name = $dflt;$comment");
+ }
+ }
+ }
+ if (field.reftype == dmmeta_Reftype_reftype_Bitfld && field.c_bitfld) {
+ JsGenBitfld();
+ }
+ if (c_fconst_N(field) && !field.c_bitfld) {
+ TsGenEnum();
+ }
+}
+
+void amc::gen_nsjs_field() {
+ ind_beg(amc::_db_ns_curs, ns, amc::_db) if (ns.c_nsjs) {
+ amc::_db.genctx.p_ns = &ns;
+ ind_beg(amc::ns_c_ctype_curs,ctype,ns) if (!ns.c_nsjs->gensel || ctype.c_jstype) {
+ amc::_db.genctx.p_ctype = &ctype;
+ ind_beg(amc::ctype_c_field_curs, field,ctype) {
+ amc::_db.genctx.p_field = &field;
+ ResetVars(amc::_db.genctx);
+ JsGenField();
+ }ind_end;
+ amc::_db.genctx.p_ctype = NULL;
+ amc::_db.genctx.p_field = NULL;
+ }ind_end;
+ }ind_end;
+}
+
+void amc::TsEncodeSimpleType(algo_lib::Replscope &R, cstring &out, amc::FField &field) {
+ Set(R,"$arg",JsGetArg(field));
+ if (field.arg == "u8") {
+ Ins(&R,out," view.setUint8($offset,$value);");
+ } else if (field.arg == "u16") {
+ Ins(&R,out," view.setUint16($offset,$value,$lend);");
+ } else if (field.arg == "u32") {
+ Ins(&R,out," view.setUint32($offset,$value,$lend);");
+ } else if (field.arg == "u64") {
+ Ins(&R,out," view.setBigUint64($offset,$value,$lend);");
+ } else if (field.arg == "i8") {
+ Ins(&R,out," view.setInt8($offset,$value);");
+ } else if (field.arg == "i16") {
+ Ins(&R,out," view.setInt16($offset,$value,$lend);");
+ } else if (field.arg == "i32") {
+ Ins(&R,out," view.setInt32($offset,$value,$lend);");
+ } else if (field.arg == "i64") {
+ Ins(&R,out," view.setBigInt64($offset,$value,$lend);");
+ } else {
+ Ins(&R,out," $arg_Encode(view,$offset,$value);");
+ TsImportMaybe(field,"$arg_Encode");
+ }
+}
+
+void amc::TsGenEncode() {
+ auto &ctype = *_db.genctx.p_ctype;
+ auto &R = _db.genctx.R;
+ cstring &out = ctype.js.funcs;
+ Ins(&R,out,"");
+ Ins(&R,out,"export function $jstype_Encode(view: DataView, offset: number, parent: $jstype) {");
+ Set(R,"$csize", tempstr() << ctype.totsize_byte);
+ Ins(&R,out," let length = $csize;");
+ ind_beg(ctype_zd_varlenfld_curs,field,ctype) {
+ Set(R,"$name",name_Get(field));
+ // write byte array at the end of the struct (length = current length of the struct)
+ if (JsByteArrayQ(field)) {
+ Ins(&R,out," new Uint8Array(view.buffer,length).set(parent.$name, parent.$name.length);");
+ Ins(&R,out," length += parent.$name.length;");
+ } else if (JsVarlenStringQ(field)) {
+ Ins(&R,out," length += _g_text_encoder.encodeInto(parent.$name,new Uint8Array(view.buffer,length)).written;");
+ }
+ if (ctype_zd_varlenfld_Next(field)) {
+ Ins(&R,out," let $name_end = length - $csize;");
+ }
+ }ind_end;
+ ind_beg(ctype_c_field_curs,field,ctype) {
+ if (field.reftype == dmmeta_Reftype_reftype_Opt) {
+ Set(R,"$name",name_Get(field));
+ Ins(&R,out," new Uint8Array(view.buffer,length).set(parent.$name, parent.$name.length);");
+ Ins(&R,out," length += parent.$name.length;");
+ }
+ }ind_end;
+ int offset(0);
+ ind_beg(ctype_c_field_curs,field,ctype) {
+ Set(R,"$name",name_Get(field));
+ Set(R,"$offset",tempstr()<<"offset+"<type);
+ } else if (field.c_lenfld) {
+ Set(R,"$extralen", tempstr() << field.c_lenfld->extra);
+ Ins(&R,out," length += $extralen;");
+ Set(R,"$value","length");
+ } else {
+ Set(R,"$value","parent.$name");
+ }
+ TsEncodeSimpleType(R,out,field);
+ offset += field.p_arg->totsize_byte;
+ } else if (field.reftype == dmmeta_Reftype_reftype_Opt) {
+ // already supported
+ } else if (JsInlaryQ(field)) {
+ Set(R,"$name",name_Get(field));
+ Ins(&R,out," new Uint8Array(view.buffer,length).set(parent.$name, parent.$name.length);");
+ Ins(&R,out," length += parent.$name.length;");
+ } else {
+ vrfy(0,tempstr()<<"amc_js.unsupported_reftype" << Keyval("field",field.field));
+ }
+ }ind_end;
+ ind_beg(ctype_zd_varlenfld_curs,field,ctype) {
+ if (ctype_zd_varlenfld_Next(field)) {
+ // write name_end
+ Set(R,"$name",name_Get(field));
+ Set(R,"$value","$name_end");
+ Set(R,"$offset",tempstr()<<"offset+"<p_field->c_fbigend?"false":"true");
+ TsEncodeSimpleType(R,out,*ctype.c_lenfld->p_field);
+ offset += ctype.c_lenfld->p_field->p_arg->totsize_byte;
+ }
+ }ind_end;
+ Ins(&R,out," return length;");
+ Ins(&R,out,"}");
+}
+
+void amc::TsDecodeSimpleType(algo_lib::Replscope &R, cstring &out, amc::FField &field) {
+ if (field.arg == "u8") {
+ Ins(&R,out," $value = view.getUint8($offset);");
+ } else if (field.arg == "u16") {
+ Ins(&R,out," $value = view.getUint16($offset,$lend);");
+ } else if (field.arg == "u32") {
+ Ins(&R,out," $value = view.getUint32($offset,$lend);");
+ } else if (field.arg == "u64") {
+ Ins(&R,out," $value = view.getBigUint64($offset,$lend);");
+ } else if (field.arg == "i8") {
+ Ins(&R,out," $value = view.getInt8($offset);");
+ } else if (field.arg == "i16") {
+ Ins(&R,out," $value = view.getInt16($offset,$lend);");
+ } else if (field.arg == "i32") {
+ Ins(&R,out," $value = view.getInt32($offset,$lend);");
+ } else if (field.arg == "i64") {
+ Ins(&R,out," $value = view.getBigInt64($offset,$lend);");
+ } else {
+ Ins(&R,out," $value = $arg_Decode(view,$offset);");
+ TsImportMaybe(field,"$arg_Decode");
+ }
+}
+
+void amc::TsGenDecode() {
+ auto &ctype = *_db.genctx.p_ctype;
+ auto &R = _db.genctx.R;
+ cstring &out = ctype.js.funcs;
+ Ins(&R,out,"");
+ Ins(&R,out,"export function $jstype_Decode(view: DataView, offset: number): $jstype {");
+ Ins(&R,out," let parent = new $jstype;");
+ int offset(0);
+ ind_beg(ctype_c_field_curs,field,ctype) {
+ Set(R,"$name",name_Get(field));
+ Set(R,"$arg",JsGetArg(field));
+ Set(R,"$offset",tempstr()<<"offset+"<totsize_byte;
+ } else if (field.reftype == dmmeta_Reftype_reftype_Val) {
+ if (field.c_lenfld) {
+ Ins(&R,out," let length = 0;");
+ Set(R,"$value","length");
+ Set(R,"$extralen", tempstr() << field.c_lenfld->extra);
+ } else {
+ Set(R,"$value","parent.$name");
+ }
+ TsDecodeSimpleType(R,out,field);
+ if (field.c_lenfld) {
+ Ins(&R,out," length -= $extralen;");
+ }
+ offset += field.p_arg->totsize_byte;
+ } else if (field.reftype == dmmeta_Reftype_reftype_Opt) {
+ // support as byte array only
+ Set(R,"$fldlength",tempstr()<<"length-"<max;
+ Set(R,"$fldlength",tempstr()<p_field->c_fbigend?"false":"true");
+ TsDecodeSimpleType(R,out,*ctype.c_lenfld->p_field);
+ offset += ctype.c_lenfld->p_field->p_arg->totsize_byte;
+ }
+ }ind_end;
+ // read fields
+ ind_beg(ctype_zd_varlenfld_curs,field,ctype) {
+ Set(R,"$name",name_Get(field));
+ Set(R,"$offset",tempstr()<<"offset+"<type);
+ Ins(&R,out," $name = $value,");
+ }ind_end;
+ Ins(&R,out,"}");
+ }
+}
+
+void amc::JsGenNs() {
+ auto &ns = *_db.genctx.p_ns;
+ auto &R = _db.genctx.R;
+ Set(R,"$ns",ns.ns);
+ Ins(&R,ns.js.body,"let _g_text_decoder = new TextDecoder('utf-8');");
+ Ins(&R,ns.js.body,"let _g_text_encoder = new TextEncoder;");
+ TsGenMsgtype();
+}
+
+void amc::gen_nsjs_ns() {
+ ind_beg(amc::_db_ns_curs, ns, amc::_db) if (ns.c_nsjs) {
+ amc::_db.genctx.p_ns = &ns;
+ ResetVars(amc::_db.genctx);
+ JsGenNs();
+ }ind_end;
+}
+
+void amc::gen_nsjs_module() {
+ auto &ns = *_db.c_ns;
+ algo_lib::Replscope R;
+ R.strict=2;
+ if (ns.c_nsjs) {
+ Set(R,"$ns",ns.ns);
+ if (ns.c_nsjs->typescript) {
+ ns.js.mdl = &outfile_Create(Subst(R,"ts/gen/$ns_gen.ts")).text;
+ Ins(&R,*ns.js.mdl,"export {};");
+ } else {
+ ns.js.mdl = &outfile_Create(Subst(R,"js/gen/$ns_gen.js")).text;
+ }
+ *ns.js.mdl << ns.js.import << ns.js.body;
+ ind_beg(ns_c_ctype_curs,ctype,ns) if (JsQ(ctype)) {
+ Set(R,"$jstype",JsType(ctype));
+ Set(R,"$args",ctype.js.args);
+ Ins(&R,*ns.js.mdl,"");
+ if (TsQ(ctype)) {
+ Ins(&R,*ns.js.mdl,"export class $jstype {");
+ InsertIndent(*ns.js.mdl,ctype.js.body,1);
+ Ins(&R,*ns.js.mdl," constructor($args) {");
+ InsertIndent(*ns.js.mdl,ctype.js.ctor,2);
+ Ins(&R,*ns.js.mdl," }");
+ Ins(&R,*ns.js.mdl,"}");
+ } else {
+ Ins(&R,*ns.js.mdl,"class $jstype {");
+ Ins(&R,*ns.js.mdl," constructor() {");
+ InsertIndent(*ns.js.mdl,ctype.js.ctor,2);
+ Ins(&R,*ns.js.mdl," Object.preventExtensions(this);");
+ Ins(&R,*ns.js.mdl," }");
+ InsertIndent(*ns.js.mdl,ctype.js.body,1);
+ Ins(&R,*ns.js.mdl,"}");
+ }
+ *ns.js.mdl << ctype.js.funcs;
+ }ind_end;
+ }
+}
diff --git a/cpp/amc/kafka.cpp b/cpp/amc/kafka.cpp
new file mode 100644
index 00000000..ae0f68f1
--- /dev/null
+++ b/cpp/amc/kafka.cpp
@@ -0,0 +1,341 @@
+// Copyright (C) 2025-2026 AlgoRND
+//
+// License: GPL
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Target: amc (exe) -- Algo Model Compiler: generate code under include/gen and cpp/gen
+// Exceptions: NO
+// Source: cpp/amc/kafka.cpp
+//
+
+#include "include/algo.h"
+#include "include/amc.h"
+
+static strptr FirstVer(strptr range) {
+ int i(0);
+ for(; ikind == dmmeta_kafka_type_kind_header;
+ Set(R, "$Cpptype", ctype.cpp_type);
+ Set(R, "$Name", name_Get(ctype));
+ amc::FFunc& func = amc::CreateCurFunc(true);
+ if (encode) {
+ Ins(&R, func.ret , "void", false);
+ AddProtoArg(func, Refto("algo::ByteAry"), "buf");
+ }
+ if (decode) {
+ AddRetval(func, "bool", "ok", "true");
+ AddProtoArg(func, Refto("algo::memptr"), "buf");
+ }
+ AddProtoArg(func, Refto(ctype.cpp_type), "parent");
+ AddProtoArg(func, "i16", "version");
+ if (decode && ctype.c_ckafka->kind == dmmeta_kafka_type_kind_response) {
+ Ins(&R,func.body,"parent.request_api_version = version;");
+ }
+ strptr vfirst;
+ strptr vlast;
+ cstring validchk;
+ if (decode) {
+ Ins(&R,func.body,"bool present(false);");
+ Ins(&R,func.body,"(void)present; // avoid unused variable");
+ Ins(&R,func.body,"u32 len(0);");
+ Ins(&R,func.body,"(void)len; // avoid unused variable");
+ }
+ if (ch_N(ctype.c_ckafka->valid_versions)) {
+ vfirst = FirstVer(ctype.c_ckafka->valid_versions);
+ vlast = LastVer(ctype.c_ckafka->valid_versions);
+ algo::ListSep ls(" && ");
+ if (ch_N(vfirst)) {
+ validchk << ls << "version>=" << vfirst;
+ }
+ if (ch_N(vlast)) {
+ validchk << ls << "version<=" << vlast;
+ }
+ }
+ if (ch_N(validchk)) {
+ Set(R,"$validverchk",validchk);
+ if (decode) {
+ Ins(&R,func.body,"ok = $validverchk;");
+ Ins(&R,func.body,"if (ok) {");
+ } else {
+ Ins(&R,func.body,"if ($validverchk) {");
+ }
+ }
+ cstring flexverchk;
+ strptr ffirst = FirstVer(ctype.c_ckafka->flexible_versions);
+ if (ch_N(ffirst)) {
+ flexverchk << "version>=" << ffirst;
+ Set(R,"$flexverchk",flexverchk);
+ Ins(&R,func.body,"bool flexible($flexverchk);");
+ } else {
+ Ins(&R,func.body,"bool flexible(false);");
+ }
+ Ins(&R,func.body,"(void)flexible; // avoid unused variable");
+ cstring lastfldverchk;
+ int count(0);
+ int n_hdr_fld(0);
+ if (FCtype *base = GetBaseType(ctype,NULL)) {
+ n_hdr_fld = c_field_N(*base);
+ }
+ ind_beg(ctype_c_field_curs,field,ctype) {
+ bool kafka = field.c_fkafka;
+ bool base = field.reftype == dmmeta_Reftype_reftype_Base;
+ bool tagged = field.c_fkafka && ch_N(field.c_fkafka->tagged_versions);
+ if (kafka && !base && !tagged) {
+ Set(R, "$Argtype", field.p_arg->cpp_type);
+ Set(R, "$fldname", name_Get(field));
+ Set(R, "$fldval", "parent.$fldname");
+ cstring fldverchk;
+ strptr first = FirstVer(field.c_fkafka->versions);
+ strptr last = LastVer(field.c_fkafka->versions);
+ algo::ListSep ls(" && ");
+ if (ch_N(first) && first != vfirst) {
+ fldverchk << ls << "version>=" << first;
+ }
+ if (ch_N(last) && last != vlast) {
+ fldverchk << ls << "version<=" << last;
+ }
+ if (fldverchk != lastfldverchk) {
+ if (ch_N(lastfldverchk)) {
+ Ins(&R,func.body,"}");
+ }
+ if (ch_N(fldverchk)) {
+ Set(R,"$fldverchk",fldverchk);
+ Ins(&R,func.body,"if ($fldverchk) {");
+ }
+ }
+ lastfldverchk = fldverchk;
+ cstring fldnulchk;
+ cstring fldprschk;
+ cstring fldprschkexpr;
+ bool prsset(false);
+ strptr nfirst = FirstVer(field.c_fkafka->nullable_versions);
+ strptr nlast = LastVer(field.c_fkafka->nullable_versions);
+ if (ch_N(nfirst)) {
+ algo::ListSep ls2(" && ");
+ if (ch_N(nfirst) && nfirst != first) {
+ fldnulchk << ls2 << "version>=" << nfirst;
+ }
+ if (ch_N(nlast) && nlast != last) {
+ fldnulchk << ls2 << "version<=" << nlast;
+ }
+ if (!ch_N(fldnulchk)) {
+ fldnulchk << "true";
+ }
+ if (c_pmaskfld_member_N(field)) {
+ Ins(&R,fldprschk,"$fldname_PresentQ(parent)",false);
+ prsset = true;
+ } else if (count < n_hdr_fld || header) {
+ vrfy(name_Get(field)=="client_id", "Can't cope with unknown nullable field in header");
+ fldprschk = "bool(ch_N(parent.client_id))";
+ }
+ } else {
+ fldnulchk << "false";
+ fldprschk << "true";
+ }
+ Set(R,"$fldnulchk",fldnulchk);
+ Set(R,"$fldprschk",fldprschk);
+ if (count < n_hdr_fld || header) {
+ Set(R,"$fldflxchk","false");
+ } else {
+ Set(R,"$fldflxchk","flexible");
+ }
+ if (encode) {
+ if (field.reftype == dmmeta_Reftype_reftype_Tary) {
+ Ins(&R,func.body,"lib_kafka::EncodeArrayLen(buf,$fldname_N(parent),$fldprschk,$fldnulchk,$fldflxchk);");
+ Ins(&R,func.body,"if ($fldprschk) {");
+ Ins(&R,func.body,"ind_beg($Cpptype_$fldname_curs,$fldname,parent) {");
+ Set(R,"$fldval","$fldname");
+ }
+ if (field.arg == "bool") {
+ Ins(&R,func.body,"algo::EncodeBoolean(buf,$fldval);");
+ } else if (field.arg == "i8") {
+ Ins(&R,func.body,"algo::EncodeI8(buf,$fldval);");
+ } else if (field.arg == "i16") {
+ Ins(&R,func.body,"lib_kafka::EncodeI16(buf,$fldval);");
+ } else if (field.arg == "i32") {
+ Ins(&R,func.body,"lib_kafka::EncodeI32(buf,$fldval);");
+ } else if (field.arg == "i64") {
+ Ins(&R,func.body,"lib_kafka::EncodeI64(buf,$fldval);");
+ } else if (field.arg == "u8") {
+ Ins(&R,func.body,"algo::EncodeU8(buf,$fldval);");
+ } else if (field.arg == "u16") {
+ Ins(&R,func.body,"lib_kafka::EncodeU16(buf,$fldval);");
+ } else if (field.arg == "u32") {
+ Ins(&R,func.body,"lib_kafka::EncodeU32(buf,$fldval);");
+ } else if (field.arg == "u64") {
+ Ins(&R,func.body,"lib_kafka::EncodeU64(buf,$fldval);");
+ } else if (field.arg == "double") {
+ Ins(&R,func.body,"lib_kafka::EncodeF64(buf,$fldval);");
+ } else if (field.arg == "algo.cstring") {
+ Ins(&R,func.body,"lib_kafka::EncodeString(buf,$fldval,$fldprschk,$fldnulchk,$fldflxchk);");
+ } else if (field.arg == "algo.ByteAry") {
+ Ins(&R,func.body,"lib_kafka::EncodeBytes(buf,$fldval,$fldprschk,$fldnulchk,$fldflxchk);");
+ } else if (field.arg == "kafka.RecordBatch") {
+ Ins(&R,func.body,"algo::ByteAry $fldname_buf;");
+ Ins(&R,func.body,"if ($fldprschk) {");
+ Ins(&R,func.body," lib_kafka::EncodeRecordBatch($fldname_buf,$fldval);");
+ Ins(&R,func.body,"}");
+ Ins(&R,func.body,"lib_kafka::EncodeBytes(buf,ary_Getary($fldname_buf),true,$fldnulchk,$fldflxchk);");
+ } else if (field.arg == "algo.Uuid") {
+ Ins(&R,func.body,"algo::EncodeUuid(buf,$fldval);");
+ } else if (field.arg == "kafka.AclOperations") {
+ Ins(&R,func.body,"lib_kafka::EncodeI32(buf,$fldval.value);");
+ } else {
+ Ins(&R,func.body,"$Argtype_KafkaEncode(buf,$fldval,version);");
+ }
+ if (field.reftype == dmmeta_Reftype_reftype_Tary) {
+ Ins(&R,func.body,"}");
+ Ins(&R,func.body,"}ind_end;");
+ }
+ }
+ if (decode) {
+ if (field.reftype == dmmeta_Reftype_reftype_Tary) {
+ Ins(&R,func.body,"ok = ok && lib_kafka::DecodeArrayLen(buf,len,present,$fldnulchk,$fldflxchk);");
+ Ins(&R,func.body,"for (u32 i=0; ic_varlenfld && field.p_arg->c_varlenfld->processed) {
- // prerr("amc.gen_llist"
- // <havecount) {
- InsVar(R, field.p_ctype , "i32", "$name_n", "", "$desc");
+ InsVar(R, field.p_ctype , "i32", "$name_n", "", desc);
}
if (llist->havetail) {
InsVar(R, field.p_ctype , "$Cpptype*", "$name_tail", "", "pointer to last element");
}
- InsVar(R, field.p_arg , "$Cpptype*", "$name_next", "", "zslist link; -1 means not-in-list");
+ InsVar(R, field.p_arg , "$Cpptype*", "$xfname_next", "", "zslist link; -1 means not-in-list");
if (listtype.haveprev) {
- InsVar(R, field.p_arg , "$Cpptype*", "$name_prev", "", "previous element");
+ InsVar(R, field.p_arg , "$Cpptype*", "$xfname_prev", "", "previous element");
}
amc::FFunc *child_init = amc::init_GetOrCreate(*field.p_arg);
Set(R, "$fname" , Refname(*field.p_arg));
- Ins(&R, child_init->body , "$fname.$name_next = ($Cpptype*)-1; // ($field) not-in-list");
+ Ins(&R, child_init->body , "$fname.$xfname_next = ($Cpptype*)-1; // ($field) not-in-list");
if (listtype.haveprev) {
- Ins(&R, child_init->body, "$fname.$name_prev = NULL; // ($field)");
+ Ins(&R, child_init->body, "$fname.$xfname_prev = NULL; // ($field)");
}
}
@@ -115,9 +108,9 @@ void amc::tfunc_Llist_InLlistQ() {
amc::FFunc& inlist = amc::CreateCurFunc();
Ins(&R, inlist.ret , "bool", false);
- Ins(&R, inlist.proto, "$name_InLlistQ($Cpptype& row)", false);
+ Ins(&R, inlist.proto, "$xfname_InLlistQ($Cpptype& row)", false);
Ins(&R, inlist.body, "bool result = false;");
- Ins(&R, inlist.body, "result = !(row.$name_next == ($Cpptype*)-1);");
+ Ins(&R, inlist.body, "result = !(row.$xfname_next == ($Cpptype*)-1);");
Ins(&R, inlist.body, "return result;");
}
@@ -154,7 +147,7 @@ void amc::tfunc_Llist_Last() {
Ins(&R, last.ret , "$Cpptype*", false);
Ins(&R, last.proto, "$name_Last($Parent)", false);
Ins(&R, last.body, "$Cpptype *row = NULL;");
- Ins(&R, last.body, "row = $parname.$name_head ? $parname.$name_head->$name_prev : NULL;");
+ Ins(&R, last.body, "row = $parname.$name_head ? $parname.$name_head->$xfname_prev : NULL;");
Ins(&R, last.body, "return row;");
}
}
@@ -166,7 +159,7 @@ void amc::tfunc_Llist_N() {
if (llist->havecount) {
amc::FFunc& nitems = amc::CreateCurFunc();
- Ins(&R, nitems.ret , "i32", false);
+ AddRetval(nitems, "i32", "", "");
Ins(&R, nitems.proto, "$name_N($Cparent)", false);
Ins(&R, nitems.body, "return $parname.$name_n;");
}
@@ -177,8 +170,8 @@ void amc::tfunc_Llist_Next() {
amc::FFunc& next = amc::CreateCurFunc();
Ins(&R, next.ret , "$Cpptype*", false);
- Ins(&R, next.proto, "$name_Next($Cpptype &row)", false);
- Ins(&R, next.body, "return row.$name_next;");
+ Ins(&R, next.proto, "$xfname_Next($Cpptype &row)", false);
+ Ins(&R, next.body, "return row.$xfname_next;");
}
void amc::tfunc_Llist_Prev() {
@@ -189,8 +182,8 @@ void amc::tfunc_Llist_Prev() {
if (llist->p_listtype->haveprev) {
amc::FFunc& prev = amc::CreateCurFunc();
Ins(&R, prev.ret , "$Cpptype*", false);
- Ins(&R, prev.proto, "$name_Prev($Cpptype &row)", false);
- Ins(&R, prev.body, "return row.$name_prev;");
+ Ins(&R, prev.proto, "$xfname_Prev($Cpptype &row)", false);
+ Ins(&R, prev.body, "return row.$xfname_prev;");
}
}
@@ -202,7 +195,7 @@ void amc::tfunc_Llist_Remove() {
amc::FFunc& remove = amc::CreateCurFunc();
Ins(&R, remove.ret , "void", false);
Ins(&R, remove.proto, "$name_Remove($Parent, $Cpptype& row)", false);
- Ins(&R, remove.body, "if ($name_InLlistQ(row)) {");
+ Ins(&R, remove.body, "if ($xfname_InLlistQ(row)) {");
Ins(&R, remove.body, " $Cpptype* old_head = $parname.$name_head;");
Ins(&R, remove.body, " (void)old_head; // in case it's not used");
@@ -210,35 +203,35 @@ void amc::tfunc_Llist_Remove() {
// this logic is somewhat convoluted. the llist->p_listtype->circular section seems much cleaner.
// are there really that many cases involved???
if (llist->p_listtype->haveprev) {
- Ins(&R, remove.body, " $Cpptype* prev = row.$name_prev;");
- Ins(&R, remove.body, " $Cpptype* next = row.$name_next;");
+ Ins(&R, remove.body, " $Cpptype* prev = row.$xfname_prev;");
+ Ins(&R, remove.body, " $Cpptype* next = row.$xfname_next;");
Ins(&R, remove.body, " // if element is first, adjust list head; otherwise, adjust previous element's next");
- Ins(&R, remove.body, " $Cpptype **new_next_a = &prev->$name_next;");
+ Ins(&R, remove.body, " $Cpptype **new_next_a = &prev->$xfname_next;");
Ins(&R, remove.body, " $Cpptype **new_next_b = &$parname.$name_head;");
Ins(&R, remove.body, " $Cpptype **new_next = prev ? new_next_a : new_next_b;");
Ins(&R, remove.body, " *new_next = next;");
if (llist->havetail) {
Ins(&R, remove.body, " // if element is last, adjust list tail; otherwise, adjust next element's prev");
- Ins(&R, remove.body, " $Cpptype **new_prev_a = &next->$name_prev;");
+ Ins(&R, remove.body, " $Cpptype **new_prev_a = &next->$xfname_prev;");
Ins(&R, remove.body, " $Cpptype **new_prev_b = &$parname.$name_tail;");
Ins(&R, remove.body, " $Cpptype **new_prev = next ? new_prev_a : new_prev_b;");
Ins(&R, remove.body, " *new_prev = prev;");
} else {
Ins(&R, remove.body, " // if element is not last, adjust next element's prev");
Ins(&R, remove.body, " if (next != NULL) {");
- Ins(&R, remove.body, " next->$name_prev = prev;");
+ Ins(&R, remove.body, " next->$xfname_prev = prev;");
Ins(&R, remove.body, " }");
}
if (llist->havecount) {
Ins(&R, remove.body, " $parname.$name_n--;");
}
- Ins(&R, remove.body, " row.$name_next=($Cpptype*)-1; // not-in-list");
+ Ins(&R, remove.body, " row.$xfname_next=($Cpptype*)-1; // not-in-list");
} else {
Ins(&R, remove.comment, "Since the list is singly-linked, use linear search to locate the element.");
Ins(&R, remove.body, " $Cpptype* prev=NULL;");
Ins(&R, remove.body, " $Cpptype* cur = $parname.$name_head;");
Ins(&R, remove.body, " while (cur) { // search for element by pointer");
- Ins(&R, remove.body, " $Cpptype* next = cur->$name_next;");
+ Ins(&R, remove.body, " $Cpptype* next = cur->$xfname_next;");
Ins(&R, remove.body, " if (cur == &row) {");
if (llist->havecount) {
Ins(&R, remove.body, " $parname.$name_n--; // adjust count");
@@ -251,11 +244,11 @@ void amc::tfunc_Llist_Remove() {
}
Ins(&R, remove.body, " // disconnect element from linked list");
Ins(&R, remove.body, " if (prev) {");
- Ins(&R, remove.body, " prev->$name_next = next;");
+ Ins(&R, remove.body, " prev->$xfname_next = next;");
Ins(&R, remove.body, " } else {");
Ins(&R, remove.body, " $parname.$name_head = next;");
Ins(&R, remove.body, " }");
- Ins(&R, remove.body, " row.$name_next = ($Cpptype*)-1; // not-in-list");
+ Ins(&R, remove.body, " row.$xfname_next = ($Cpptype*)-1; // not-in-list");
Ins(&R, remove.body, " break;");
Ins(&R, remove.body, " }");
Ins(&R, remove.body, " prev = cur;");
@@ -263,21 +256,21 @@ void amc::tfunc_Llist_Remove() {
Ins(&R, remove.body, " }");
}
} else { // llist->p_listtype->circular
- Ins(&R, remove.body, " $Cpptype *oldnext = row.$name_next;");
+ Ins(&R, remove.body, " $Cpptype *oldnext = row.$xfname_next;");
if (llist->p_listtype->haveprev) {
- Ins(&R, remove.body, " $Cpptype *oldprev = row.$name_prev;");
+ Ins(&R, remove.body, " $Cpptype *oldprev = row.$xfname_prev;");
} else {
Ins(&R, remove.comment, "Since the list is singly-linked, use linear search to locate the element.");
Ins(&R, remove.body, " // find previous element with linear search -- always scans the entire list");
- Ins(&R, remove.body, " $Cpptype *oldprev = row.$name_next;");
- Ins(&R, remove.body, " while (oldprev->$name_next != &row) {");
- Ins(&R, remove.body, " oldprev = oldprev->$name_next;");
+ Ins(&R, remove.body, " $Cpptype *oldprev = row.$xfname_next;");
+ Ins(&R, remove.body, " while (oldprev->$xfname_next != &row) {");
+ Ins(&R, remove.body, " oldprev = oldprev->$xfname_next;");
Ins(&R, remove.body, " }");
}
if (llist->p_listtype->haveprev) {
- Ins(&R, remove.body, " oldnext->$name_prev = oldprev; // remove element from list");
+ Ins(&R, remove.body, " oldnext->$xfname_prev = oldprev; // remove element from list");
}
- Ins(&R, remove.body, " oldprev->$name_next = oldnext;");
+ Ins(&R, remove.body, " oldprev->$xfname_next = oldnext;");
if (llist->havecount) {
Ins(&R, remove.body, " $parname.$name_n--; // adjust count");
}
@@ -289,9 +282,9 @@ void amc::tfunc_Llist_Remove() {
Ins(&R, remove.body, " $parname.$name_tail = oldprev==&row ? NULL : oldprev; // adjust list tail");
Ins(&R, remove.body, " }");
}
- Ins(&R, remove.body, " row.$name_next = ($Cpptype*)-1; // mark element as not-in-list);");
+ Ins(&R, remove.body, " row.$xfname_next = ($Cpptype*)-1; // mark element as not-in-list);");
if (llist->p_listtype->haveprev) {
- Ins(&R, remove.body, " row.$name_prev = NULL; // clear back-pointer");
+ Ins(&R, remove.body, " row.$xfname_prev = NULL; // clear back-pointer");
}
}
if (field.need_firstchanged) {
@@ -325,10 +318,10 @@ void amc::tfunc_Llist_RemoveAll() {
Ins(&R, flush.body, "bool do_fire = (NULL != row);");
}
Ins(&R, flush.body, "while (row) {");
- Ins(&R, flush.body, " $Cpptype* row_next = row->$name_next;");
- Ins(&R, flush.body, " row->$name_next = ($Cpptype*)-1;");
+ Ins(&R, flush.body, " $Cpptype* row_next = row->$xfname_next;");
+ Ins(&R, flush.body, " row->$xfname_next = ($Cpptype*)-1;");
if (llist->p_listtype->haveprev) {
- Ins(&R, flush.body, " row->$name_prev = NULL;");
+ Ins(&R, flush.body, " row->$xfname_prev = NULL;");
}
if (!llist->p_listtype->circular) {
Ins(&R, flush.body, " row = row_next;");
@@ -355,11 +348,11 @@ void amc::tfunc_Llist_RemoveFirst() {
Ins(&R, remfirst.body, "row = $parname.$name_head;");
Ins(&R, remfirst.body, "if (row) {");
if (!llist->p_listtype->circular) {
- Ins(&R, remfirst.body, " $Cpptype *next = row->$name_next;");
+ Ins(&R, remfirst.body, " $Cpptype *next = row->$xfname_next;");
Ins(&R, remfirst.body, " $parname.$name_head = next;");
if (llist->havetail) {
if (llist->p_listtype->haveprev) {
- Ins(&R, remfirst.body, " $Cpptype **new_end_a = &next->$name_prev;");
+ Ins(&R, remfirst.body, " $Cpptype **new_end_a = &next->$xfname_prev;");
Ins(&R, remfirst.body, " $Cpptype **new_end_b = &$parname.$name_tail;");
Ins(&R, remfirst.body, " $Cpptype **new_end = next ? new_end_a : new_end_b;");
Ins(&R, remfirst.body, " *new_end = NULL;");
@@ -371,14 +364,14 @@ void amc::tfunc_Llist_RemoveFirst() {
}
}
} else {
- Ins(&R, remfirst.body, " bool hasmore = row!=row->$name_next;");
- Ins(&R, remfirst.body, " $parname.$name_head = hasmore ? row->$name_next : NULL;");
+ Ins(&R, remfirst.body, " bool hasmore = row!=row->$xfname_next;");
+ Ins(&R, remfirst.body, " $parname.$name_head = hasmore ? row->$xfname_next : NULL;");
if (llist->p_listtype->haveprev) {
- Ins(&R, remfirst.body, " row->$name_next->$name_prev = row->$name_prev;");
- Ins(&R, remfirst.body, " row->$name_prev->$name_next = row->$name_next;");
- Ins(&R, remfirst.body, " row->$name_prev = NULL;");
+ Ins(&R, remfirst.body, " row->$xfname_next->$xfname_prev = row->$xfname_prev;");
+ Ins(&R, remfirst.body, " row->$xfname_prev->$xfname_next = row->$xfname_next;");
+ Ins(&R, remfirst.body, " row->$xfname_prev = NULL;");
} else if (llist->havetail) {
- Ins(&R, remfirst.body, " $parname.$name_tail->$name_next = row->$name_next;");
+ Ins(&R, remfirst.body, " $parname.$name_tail->$xfname_next = row->$xfname_next;");
Ins(&R, remfirst.body, " // clear list's tail pointer if list is empty.");
Ins(&R, remfirst.body, " if (!hasmore) {");
Ins(&R, remfirst.body, " $parname.$name_tail = NULL;");
@@ -391,7 +384,7 @@ void amc::tfunc_Llist_RemoveFirst() {
if (llist->havecount) {
Ins(&R, remfirst.body, " $parname.$name_n--;");
}
- Ins(&R, remfirst.body, " row->$name_next = ($Cpptype*)-1; // mark as not-in-list");
+ Ins(&R, remfirst.body, " row->$xfname_next = ($Cpptype*)-1; // mark as not-in-list");
if (field.need_firstchanged) {
Ins(&R, remfirst.comment, "Call FirstChanged trigger.");
Ins(&R, remfirst.body, " $name_FirstChanged($pararg);");
@@ -415,7 +408,7 @@ void amc::tfunc_Llist_RotateFirst() {
if (llist->havetail) {
Ins(&R, rotfirst.body, " $parname.$name_tail = $parname.$name_head;");
}
- Ins(&R, rotfirst.body, " $parname.$name_head = row->$name_next;");
+ Ins(&R, rotfirst.body, " $parname.$name_head = row->$xfname_next;");
Ins(&R, rotfirst.body, "}");
Ins(&R, rotfirst.body, "return row;");
}
@@ -430,48 +423,48 @@ void amc::tfunc_Llist_Insert() {
// private function to update the linked list.
amc::FFunc& ins = amc::CreateCurFunc();
Ins(&R, ins.proto, "$name_Insert($Parent, $Cpptype& row)", false);
- Ins(&R, ins.body, "if (!$name_InLlistQ(row)) {");
+ Ins(&R, ins.body, "if (!$xfname_InLlistQ(row)) {");
Ins(&R, ins.ret , "void", false);
if (!listtype.circular) {
// doubly linked list case
if (listtype.haveprev) {
if (listtype.instail) {// doubly linked, tail insertion
Ins(&R, ins.body, " $Cpptype* old_tail = $parname.$name_tail;");
- Ins(&R, ins.body, " row.$name_next = NULL;");
- Ins(&R, ins.body, " row.$name_prev = old_tail;");
+ Ins(&R, ins.body, " row.$xfname_next = NULL;");
+ Ins(&R, ins.body, " row.$xfname_prev = old_tail;");
Ins(&R, ins.body, " $parname.$name_tail = &row;");
- Ins(&R, ins.body, " $Cpptype **new_row_a = &old_tail->$name_next;");
+ Ins(&R, ins.body, " $Cpptype **new_row_a = &old_tail->$xfname_next;");
Ins(&R, ins.body, " $Cpptype **new_row_b = &$parname.$name_head;");
Ins(&R, ins.body, " $Cpptype **new_row = old_tail ? new_row_a : new_row_b;");
Ins(&R, ins.body, " *new_row = &row;");
} else { // doubly linked, head insertion
Ins(&R, ins.body, " $Cpptype* old_head = $parname.$name_head;");
- Ins(&R, ins.body, " row.$name_prev = NULL;");
- Ins(&R, ins.body, " row.$name_next = old_head;");
+ Ins(&R, ins.body, " row.$xfname_prev = NULL;");
+ Ins(&R, ins.body, " row.$xfname_next = old_head;");
Ins(&R, ins.body, " $parname.$name_head = &row;");
if (llist->havetail) {
- Ins(&R, ins.body, " $Cpptype **new_row_a = &old_head->$name_prev;");
+ Ins(&R, ins.body, " $Cpptype **new_row_a = &old_head->$xfname_prev;");
Ins(&R, ins.body, " $Cpptype **new_row_b = &$parname.$name_tail;");
Ins(&R, ins.body, " $Cpptype **new_row = old_head ? new_row_a : new_row_b;");
Ins(&R, ins.body, " *new_row = &row;");
} else {
Ins(&R, ins.body, " if (old_head) {");
- Ins(&R, ins.body, " old_head->$name_prev = &row;");
+ Ins(&R, ins.body, " old_head->$xfname_prev = &row;");
Ins(&R, ins.body, " }");
}
}
} else {
if (listtype.instail) { // singly linked, tail insertion
Ins(&R, ins.body, " $Cpptype* old_tail = $parname.$name_tail;");
- Ins(&R, ins.body, " row.$name_next = NULL;");
+ Ins(&R, ins.body, " row.$xfname_next = NULL;");
Ins(&R, ins.body, " $parname.$name_tail = &row;");
- Ins(&R, ins.body, " $Cpptype **new_row_a = &old_tail->$name_next;");
+ Ins(&R, ins.body, " $Cpptype **new_row_a = &old_tail->$xfname_next;");
Ins(&R, ins.body, " $Cpptype **new_row_b = &$parname.$name_head;");
Ins(&R, ins.body, " $Cpptype **new_row = old_tail ? new_row_a : new_row_b;");
Ins(&R, ins.body, " *new_row = &row;");
} else { // singly linked, head insertion
Ins(&R, ins.body, " $Cpptype* old_head = $parname.$name_head;");
- Ins(&R, ins.body, " row.$name_next = old_head;");
+ Ins(&R, ins.body, " row.$xfname_next = old_head;");
Ins(&R, ins.body, " $parname.$name_head = &row;");
if (llist->havetail) {
Ins(&R, ins.body, " if (!old_head) {");
@@ -482,13 +475,13 @@ void amc::tfunc_Llist_Insert() {
}
} else { // llist->p_listtype->circular
Ins(&R, ins.body, " if ($parname.$name_head) {");
- Ins(&R, ins.body, " row.$name_next = $parname.$name_head;");
+ Ins(&R, ins.body, " row.$xfname_next = $parname.$name_head;");
if (listtype.haveprev) {
- Ins(&R, ins.body, " row.$name_prev = $parname.$name_head->$name_prev;");
- Ins(&R, ins.body, " row.$name_prev->$name_next = &row;");
- Ins(&R, ins.body, " row.$name_next->$name_prev = &row;");
+ Ins(&R, ins.body, " row.$xfname_prev = $parname.$name_head->$xfname_prev;");
+ Ins(&R, ins.body, " row.$xfname_prev->$xfname_next = &row;");
+ Ins(&R, ins.body, " row.$xfname_next->$xfname_prev = &row;");
} else if (llist->havetail) {
- Ins(&R, ins.body, " $parname.$name_tail->$name_next = &row;");
+ Ins(&R, ins.body, " $parname.$name_tail->$xfname_next = &row;");
if (listtype.instail) {
Ins(&R, ins.body, " $parname.$name_tail = &row;");
}
@@ -500,9 +493,9 @@ void amc::tfunc_Llist_Insert() {
Ins(&R, ins.body, " $parname.$name_head = &row;");
}
Ins(&R, ins.body, " } else {");
- Ins(&R, ins.body, " row.$name_next = &row;");
+ Ins(&R, ins.body, " row.$xfname_next = &row;");
if (listtype.haveprev) {
- Ins(&R, ins.body, " row.$name_prev = &row;");
+ Ins(&R, ins.body, " row.$xfname_prev = &row;");
}
Ins(&R, ins.body, " $parname.$name_head = &row;");
if (llist->havetail) {
@@ -544,7 +537,7 @@ void amc::tfunc_Llist_qLast() {
Ins(&R, qlast.ret , "$Cpptype&", false);
Ins(&R, qlast.proto, "$name_qLast($Parent)", false);
Ins(&R, qlast.body, "$Cpptype *row = NULL;");
- Ins(&R, qlast.body, "row = $parname.$name_head ? $parname.$name_head->$name_prev : NULL;");
+ Ins(&R, qlast.body, "row = $parname.$name_head ? $parname.$name_head->$xfname_prev : NULL;");
Ins(&R, qlast.body, "return *row;");
}
}
@@ -561,10 +554,10 @@ void amc::tclass_ZSListMT() {
InsStruct(R, field.p_ctype, "");
InsVar(R, field.p_ctype, "$Cpptype*", "$name_head", "", "ZSListMT - zero-terminated singly linked list -- read side");
InsVar(R, field.p_ctype, "$Cpptype*", "$name_mt", "", "elements inserted here from another thread -- write side");
- InsVar(R, field.p_arg, "$Cpptype*", "$name_next", "", "zslist link; -1 means not-in-list");
+ InsVar(R, field.p_arg, "$Cpptype*", "$xfname_next", "", "zslist link; -1 means not-in-list");
Ins(&R, child_init->body , "");
Ins(&R, child_init->body , "// ($field) not-in-list");
- Ins(&R, child_init->body , "$fname.$name_next = ($Cpptype*)-1;");
+ Ins(&R, child_init->body , "$fname.$xfname_next = ($Cpptype*)-1;");
}
void amc::tfunc_ZSListMT_DestructiveFirst() {
@@ -586,8 +579,8 @@ void amc::tfunc_ZSListMT_DestructiveFirst() {
Ins(&R, first.body, " $Cpptype* temp = __sync_lock_test_and_set(&$parname.$name_mt, NULL);");
Ins(&R, first.body, " if (temp) {");
Ins(&R, first.body, " do {");
- Ins(&R, first.body, " $Cpptype* next = temp->$name_next;");
- Ins(&R, first.body, " temp->$name_next = row;");
+ Ins(&R, first.body, " $Cpptype* next = temp->$xfname_next;");
+ Ins(&R, first.body, " temp->$xfname_next = row;");
Ins(&R, first.body, " row = temp;");
Ins(&R, first.body, " temp = next;");
Ins(&R, first.body, " } while (temp);");
@@ -606,9 +599,9 @@ void amc::tfunc_ZSListMT_RemoveFirst() {
Ins(&R, remfirst.proto, "$name_RemoveFirst($Parent)", false);
Ins(&R, remfirst.body, "$Cpptype *row = $name_DestructiveFirst($pararg);");
Ins(&R, remfirst.body, "if (row) {");
- Ins(&R, remfirst.body, " $Cpptype *next = row->$name_next;");
+ Ins(&R, remfirst.body, " $Cpptype *next = row->$xfname_next;");
Ins(&R, remfirst.body, " $parname.$name_head = next;");
- Ins(&R, remfirst.body, " row->$name_next = ($Cpptype*)-1; // mark as not-in-list");
+ Ins(&R, remfirst.body, " row->$xfname_next = ($Cpptype*)-1; // mark as not-in-list");
Ins(&R, remfirst.body, "}");
Ins(&R, remfirst.body, "return row;");
}
@@ -619,9 +612,9 @@ void amc::tfunc_ZSListMT_InLlistQ() {
amc::FFunc& inlist = amc::CreateCurFunc();
inlist.inl=true;
Ins(&R, inlist.ret , "bool", false);
- Ins(&R, inlist.proto, "$name_InLlistQ($Cpptype& row)", false);
+ Ins(&R, inlist.proto, "$xfname_InLlistQ($Cpptype& row)", false);
Ins(&R, inlist.body, "bool result = false;");
- Ins(&R, inlist.body, "result = !(row.$name_next == ($Cpptype*)-1);");
+ Ins(&R, inlist.body, "result = !(row.$xfname_next == ($Cpptype*)-1);");
Ins(&R, inlist.body, "return result;");
}
@@ -631,13 +624,13 @@ void amc::tfunc_ZSListMT_Insert() {
amc::FFunc& insert = amc::CreateCurFunc();
Ins(&R, insert.ret , "void", false);
Ins(&R, insert.proto, "$name_Insert($Parent, $Cpptype& row)", false);
- Ins(&R, insert.body, "if (!$name_InLlistQ(row)) {");
+ Ins(&R, insert.body, "if (!$xfname_InLlistQ(row)) {");
Ins(&R, insert.body, " // insertion into thread-safe linked list.");
Ins(&R, insert.body, " $Cpptype *temp = NULL;");
Ins(&R, insert.body, " $Cpptype *oldval = $parname.$name_mt;");
Ins(&R, insert.body, " do {");
Ins(&R, insert.body, " temp = oldval;");
- Ins(&R, insert.body, " row.$name_next = temp;");
+ Ins(&R, insert.body, " row.$xfname_next = temp;");
Ins(&R, insert.body, " oldval = __sync_val_compare_and_swap(&$parname.$name_mt, temp, &row);");
Ins(&R, insert.body, " } while (oldval != temp);");
Ins(&R, insert.body, "}");
@@ -711,7 +704,7 @@ void amc::Llist_curs(bool needdel) {
// so it must be ignored.
if (needdel) {
Ins(&R, func.body, "if (curs.row) {");
- Ins(&R, func.body, " curs.next = (*curs.row).$name_next;");
+ Ins(&R, func.body, " curs.next = (*curs.row).$xfname_next;");
if (circular) {
Ins(&R, func.body, " if (curs.next == *curs.head) {");
Ins(&R, func.body, " curs.next = NULL;");
@@ -737,7 +730,7 @@ void amc::Llist_curs(bool needdel) {
if (needdel) {
Ins(&R, func.body, "$Cpptype *next = curs.next;");
} else {
- Ins(&R, func.body, "$Cpptype *next = (*curs.row).$name_next;");
+ Ins(&R, func.body, "$Cpptype *next = (*curs.row).$xfname_next;");
}
Ins(&R, func.body, "curs.row = next;");
if (circular && !needdel) {
@@ -747,7 +740,7 @@ void amc::Llist_curs(bool needdel) {
}
if (needdel) {
Ins(&R, func.body, "if (curs.row) {");
- Ins(&R, func.body, " curs.next = (*curs.row).$name_next;");
+ Ins(&R, func.body, " curs.next = (*curs.row).$xfname_next;");
if (circular) {
Ins(&R, func.body, "if (curs.next == *curs.head) {");
Ins(&R, func.body, " curs.next = NULL;");
diff --git a/cpp/amc/lpool.cpp b/cpp/amc/lpool.cpp
index b7153e0a..c2425a3e 100644
--- a/cpp/amc/lpool.cpp
+++ b/cpp/amc/lpool.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/main.cpp b/cpp/amc/main.cpp
index bc234d08..51be17eb 100644
--- a/cpp/amc/main.cpp
+++ b/cpp/amc/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2013 AlgoEngineering LLC
@@ -23,17 +23,8 @@
// Source: cpp/amc/main.cpp -- Main driver
//
// Algo Model Compiler (AMC)
-// TODO: $ errlist 'cd ~/proj/.testgen && (cd ../ && abt amc && dflt.debug-x86_64/amc -out_dir .testgen) && abt -install %'
-// TODO: AB-17400: target:amc: make buffers bidirectional by default
-// TODO: acms_script -> amc_sh
-// TODO: amc -size is broken:
// TODO: amc can't delete double cascdel
-// TODO: amc extra unnecessary strings: ~40k
-// TODO: amc steps: tutorial
-// TODO: amc.error where:load_input amc.xref_error xref:amc.FFixfield.p_fixtag via:amc.FDb.ind_fixtag key:'Account'
// TODO: amc: Base field must be first -- otherwise no castbase
-// TODO: amc: Cmp - define over Tary
-// TODO: amc: add Alias reftype
// TODO: amc: add UpdateTrace function
// TODO: amc: add fldoffset for first data field of Base -- must be zero?
// TODO: amc: add instname
@@ -58,7 +49,6 @@
// TODO: amc: generate builtins.
// TODO: amc: generate cursors as regular ctypes
// TODO: amc: mark whole namespace as key namespace?
-// TODO: amc: merge xrefvia + xreffld into xrefpath?
// TODO: amc: newfield: pluggable
// TODO: amc: print ctype functions with their ctype
// TODO: amc: print ctype functions with their ctype. cstring: define fcmp
@@ -67,11 +57,9 @@
// TODO: amc: replace numstr with a fldfunc.
// TODO: amc: suggest cheapcopy types?
// TODO: amc: support fnotify for ibendpt
-// TODO: amc: types that don't have Global don't get StaticCheck generated -- for instance global namespace
// TODO: amc: use top-down Cmp, Lt generator for Smallstr.
// TODO: amc_vis: print ns summary
// TODO: amcdb: add pool table
-// TODO: cstring operator ==, < must be defined by amc (default one)
// TODO: do not make amc dependent on the conversion -- use elems_Getary where necessary
// TODO: does amc support defaults for bitfld?
// TODO: fix generation of cross-namespace steps in amc (currently broken -- confuses step namespace with field namespace)
@@ -265,8 +253,14 @@ amc::FField *amc::FirstInst(amc::FCtype &ctype) {
// -----------------------------------------------------------------------------
+// Return TRUE if the given step executes directly from the scheduling Step function
+// Indirect steps are those called through a Timehook.
bool amc::DirectStepQ(amc::FFstep &fstep) {
- return !(fstep.steptype == dmmeta_Steptype_steptype_TimeHookRecur);
+ return fstep.steptype == dmmeta_Steptype_steptype_Callback
+ || fstep.steptype == dmmeta_Steptype_steptype_Extern
+ || fstep.steptype == dmmeta_Steptype_steptype_Inline
+ || fstep.steptype == dmmeta_Steptype_steptype_InlineOnce
+ || fstep.steptype == dmmeta_Steptype_steptype_InlineRecur;
}
// -----------------------------------------------------------------------------
@@ -353,18 +347,6 @@ tempstr amc::Initcast(amc::FField &field) {
// -----------------------------------------------------------------------------
-// True if ctype is instantiated through a memory pool that has an Alloc function.
-bool amc::PoolHasAllocQ(amc::FCtype &ctype) {
- bool retval=false;
- ind_beg(amc::ctype_zd_inst_curs,inst,ctype) if (inst.p_reftype->hasalloc) {
- retval=true;
- break;
- }ind_end;
- return retval;
-}
-
-// -----------------------------------------------------------------------------
-
void amc::GenPrintStmt(cstring &out, amc::FCtype &parenttype, amc::FField &field, strptr strname, strptr parentname) {
if (amc::FFunc* func = amc::ind_func_Find(dmmeta::Func_Concat_field_name(field.field,"Print"))) {
vrfy(!func->ismacro, tempstr()<<"invalid macro print function "<func);
@@ -385,7 +367,7 @@ bool amc::FldfuncQ(amc::FField &field) {
bool amc::CanCopyQ(amc::FCtype &ctype) {
amc::FCtype *fldbase = GetBaseType(ctype,NULL);
- bool can_copy = fldbase && !fldbase->c_varlenfld && !ctype.c_varlenfld;
+ bool can_copy = fldbase && zd_varlenfld_EmptyQ(*fldbase) && zd_varlenfld_EmptyQ(ctype);
// cannot copy if any of the parent fields are a Tary
// cannot copy if any of the parent fields have a private copy constructor
// or disallow a copy operator.
@@ -719,7 +701,11 @@ bool amc::FixaryQ(amc::FField &field) {
// parent.field
// field_Get(parent)
// field_Get(parent.subfield)
-tempstr amc::FieldvalExpr(amc::FCtype *ctype, amc::FField &field, strptr parname) {
+tempstr amc::FieldvalExpr(amc::FCtype *ctype, amc::FField &field, strptr parname, strptr fldname DFLTVAL(strptr())) {
+ cstring name(fldname);
+ if (!ch_N(name)) {
+ name = name_Get(field);
+ }
tempstr ret;
bool need_get = field.c_fbigend || FldfuncQ(field) || field.c_bitfld;
tempstr path;
@@ -783,12 +769,12 @@ tempstr amc::FieldvalExpr(amc::FCtype *ctype, amc::FField &field, strptr parname
}
// use the shortest form of accessing the field -- omit _Get if necessary
if (need_get) {
- ret << name_Get(field)<<"_Get("<0 && parname[0] == '*') {
ret << RestFrom(parname,1) << "->";
} else {
ret << parname << ".";
}
- ret << name_Get(field)<<" = "<p_field;
algo_lib::Replscope R;
+ R.strict=2;
Set(R,"$Cpptype",amc::NsToCpp(parent.ctype));
Ins(&R, fctype.body, "typedef $Cpptype *ChildType;");// add a typedef
amc::InsField(dmmeta::Field(tempstr()<hdr, *ns, "");
- Ins(&R, *ns->hdr, "struct FStream;");
- Ins(&R, *ns->hdr, "void *BeginWrite(lib_ams::FStream &stream, int len);");
- Ins(&R, *ns->hdr, "void EndWrite(lib_ams::FStream &stream, void *msg, int len);");
+ Ins(&R, *ns->hdr, "struct FShm;");
+ Ins(&R, *ns->hdr, "void *BeginWrite(lib_ams::FShm &shm, int len);");
+ Ins(&R, *ns->hdr, "void EndWrite(lib_ams::FShm &shm, void *msg, int len);");
EndNsBlock(*ns->hdr, *ns, "");
}
}
- Ins(&R, pnew.preamble, "msg = ($Cpptype*)lib_ams::BeginWrite(stream,int(len));");
+ Ins(&R, pnew.preamble, "msg = ($Cpptype*)lib_ams::BeginWrite(shm,int(len));");
Ins(&R, pnew.preamble, "if (!msg) {");
Ins(&R, pnew.preamble, " return NULL; // no room.");
Ins(&R, pnew.preamble, "}");
- Ins(&R, pnew.postamble, "lib_ams::EndWrite(stream,msg,int(len));");
+ Ins(&R, pnew.postamble, "lib_ams::EndWrite(shm,msg,int(len));");
}
// -----------------------------------------------------------------------------
@@ -110,7 +110,16 @@ static void Pnew_CopyFields(amc::Genpnew &genpnew) {
Set(R, "$extra", tempstr() << lenfld->extra);
Ins(&R, func.body, AssignExpr(field, "*msg", "len + ($extra)", true)<<";");
} else if (field.reftype == dmmeta_Reftype_reftype_Varlen) {
- Ins(&R, func.body, "memcpy($name_Addr(*msg), $name.elems, ary_len);");
+ Ins(&R, func.body, "memcpy($name_Addr(*msg), $name.elems, $name_ary_len);");
+ if (ctype_zd_varlenfld_Next(field)) {
+ if (ctype_zd_varlenfld_Prev(field)) {
+ Set(R, "$prevendexpr", VarlenEndExpr("(*msg)",*ctype_zd_varlenfld_Prev(field)));
+ Set(R, "$endassign", VarlenEndAssign("(*msg)",field,Subst(R,"$prevendexpr + $name_ary_len")));
+ } else {
+ Set(R, "$endassign", VarlenEndAssign("(*msg)",field,Subst(R,"$name_ary_len")));
+ }
+ Ins(&R, func.body, "$endassign;");
+ }
} else if (field.reftype == dmmeta_Reftype_reftype_Opt) {
Ins(&R, func.body, "if ($name) {");
Ins(&R, func.body, " memcpy((u8*)msg + sizeof($Cpptype), $name, opt_len);");
@@ -129,13 +138,12 @@ static void HandleLen(amc::Genpnew &genpnew) {
amc::FCtype &ctype = *genpnew.p_ctype;
Ins(&R, func.body, "size_t len = sizeof($Cpptype);");
-
- if (ctype.c_varlenfld) {
- Set(R, "$name", name_Get(*ctype.c_varlenfld));
- Set(R, "$Vartype", ctype.c_varlenfld->p_arg->c_lenfld ? strptr("u8") : ctype.c_varlenfld->cpp_type);
- Ins(&R, func.body, tempstr() << "u32 ary_len = elems_N($name) * sizeof($Vartype);");
- Ins(&R, func.body, "len += ary_len;");
- }
+ ind_beg(amc::ctype_zd_varlenfld_curs,varlenfld,ctype) {
+ Set(R, "$name", name_Get(varlenfld));
+ Set(R, "$Vartype", varlenfld.p_arg->c_lenfld ? strptr("u8") : varlenfld.cpp_type);
+ Ins(&R, func.body, tempstr() << "u32 $name_ary_len = elems_N($name) * sizeof($Vartype);");
+ Ins(&R, func.body, "len += $name_ary_len;");
+ }ind_end;
if (ctype.c_optfld) {
Set(R, "$name", name_Get(*ctype.c_optfld));
@@ -158,7 +166,7 @@ static void DispatchBuftype(amc::FPnew &pnew, amc::Genpnew &genpnew) {
switch(pnewtype) {
case amc_Pnewtype_Memptr : PnewMemptr(R, genpnew); break;
case amc_Pnewtype_ByteAry : PnewByteAry(R, genpnew); break;
- case amc_Pnewtype_AmsStream : PnewAmsStream(R, genpnew); break;
+ case amc_Pnewtype_Shm : PnewShm(R, genpnew); break;
case amc_Pnewtype_Append : PnewAppend(R, genpnew); break;
default : vrfy(0, "unsupported buftype"); break;
}
diff --git a/cpp/amc/pool.cpp b/cpp/amc/pool.cpp
index cb84929a..47800bc4 100644
--- a/cpp/amc/pool.cpp
+++ b/cpp/amc/pool.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
@@ -37,7 +37,7 @@
// because some_exe.FTable has an Opt field
static bool NeedAllocExtraQ(amc::FField &field) {
amc::FCtype &ctype = *field.p_arg;
- return ctype.c_lenfld && (ctype.c_optfld || ctype.c_varlenfld);
+ return ctype.c_lenfld && (ctype.c_optfld || !zd_varlenfld_EmptyQ(ctype));
}
// -----------------------------------------------------------------------------
@@ -47,9 +47,15 @@ void amc::tclass_Pool() {
amc::FField &field = *amc::_db.genctx.p_field;
amc::FCtype& fldtype = *field.p_arg;
- if (fldtype.c_varlenfld) {
- Set(R, "$vartype", fldtype.c_varlenfld->cpp_type);
- Set(R, "$varfld", name_Get(*fldtype.c_varlenfld));
+ // TODO remove this restricion
+ vrfy(zd_varlenfld_N(fldtype)<=1, tempstr()
+ <cpp_type);
+ Set(R, "$varfld", name_Get(*zd_varlenfld_First(fldtype)));
}
if (NeedAllocExtraQ(field) && !field.p_reftype->varlen) {
prerr("amc.one_size_doesnt_fit_all"
@@ -65,7 +71,7 @@ void amc::tclass_Pool() {
static void GenAllocFunc(algo_lib::Replscope &R, amc::FFunc &func, amc::FField &field) {
bool poolvarlen = PoolVarlenQ(field);
amc::AddRetval(func, Subst(R,"$Cpptype*"), "row", Subst(R,"($Cpptype*)$name_AllocMem($pararg)"));
- amc::AddArg(func.body, Subst(R,"$totlenexpr"), poolvarlen);
+ amc::AddArg(func.body, Subst(R,"$poolvarlen"), poolvarlen);
Ins(&R, func.body , "if (row) {");
Ins(&R, func.body , " new (row) $Cpptype; // call constructor");
// initialize rowid
@@ -77,7 +83,7 @@ static void GenAllocFunc(algo_lib::Replscope &R, amc::FFunc &func, amc::FField &
amc::FLenfld *lenfld = (*field.p_arg).c_lenfld;
if (lenfld) {
Set(R, "$extra", tempstr() << field.p_arg->c_lenfld->extra);
- Set(R, "$setlen", AssignExpr(*lenfld->p_field, "*row", "$totlenexpr - $extra", true));
+ Set(R, "$setlen", AssignExpr(*lenfld->p_field, "*row", "$poolvarlen - $extra", true));
Ins(&R, func.body, " $setlen;");
}
// initialize type field
@@ -107,13 +113,13 @@ void amc::tfunc_Pool_AllocMaybe() {
if (!field.p_arg->c_optfld) {
amc::FCtype& fldtype = *field.p_arg;
amc::FFunc& func = amc::CreateCurFunc(true);
- AddProtoArg(func,"i32","n_varfld",fldtype.c_varlenfld);
+ AddProtoArg(func,"i32","n_varfld",zd_varlenfld_First(fldtype));
if (NeedAllocExtraQ(field)) {
// this is a varlen struct -- no opt
func.inl = true;
AddRetval(func, Subst(R,"$Cpptype*"), "row", Subst(R,"$name_AllocExtraMaybe($pararg, NULL, sizeof($vartype) * n_varfld)"));
} else {
- Set(R, "$totlenexpr", "sizeof($Cpptype)");
+ Set(R, "$poolvarlen", "sizeof($Cpptype)");
GenAllocFunc(R,func,field);
}
}
@@ -127,11 +133,11 @@ void amc::tfunc_Pool_Alloc() {
if (!field.p_arg->c_optfld) {
amc::FCtype& fldtype = *field.p_arg;
amc::FFunc& func = amc::CreateCurFunc(true);
- AddProtoArg(func, "i32", "n_varfld", fldtype.c_varlenfld);
+ AddProtoArg(func, "i32", "n_varfld", zd_varlenfld_First(fldtype));
AddRetval(func, Subst(R,"$Cpptype&"), "", "");
Ins(&R, func.body , "$Cpptype* row = $name_AllocMaybe($pararg);");
- AddArg(func.body, "n_varfld", fldtype.c_varlenfld);
- if (fldtype.c_varlenfld) {
+ AddArg(func.body, "n_varfld", zd_varlenfld_First(fldtype));
+ if (zd_varlenfld_First(fldtype)) {
Ins(&R, func.comment, "Allocate memory for a new row with N_VARFLD var-len elements");
} else {
Ins(&R, func.comment, "Allocate memory for new default row.");
@@ -156,7 +162,7 @@ void amc::tfunc_Pool_AllocExtraMaybe() {
amc::FFunc& func = amc::CreateCurFunc(true);
AddProtoArg(func, "void *", "extra");
AddProtoArg(func, "i32", "nbyte_extra");
- Set(R, "$totlenexpr", "sizeof($Cpptype) + nbyte_extra");
+ Set(R, "$poolvarlen", "sizeof($Cpptype) + nbyte_extra");
GenAllocFunc(R,func,field);
}
}
@@ -188,7 +194,7 @@ void amc::tfunc_Pool_AllocVarlenMaybe() {
algo_lib::Replscope &R = amc::_db.genctx.R;
amc::FField &field = *amc::_db.genctx.p_field;
amc::FCtype& fldtype = *field.p_arg;
- if (fldtype.c_varlenfld) {
+ if (zd_varlenfld_First(fldtype)) {
amc::FFunc& func = amc::CreateCurFunc();
func.inl=true;
Ins(&R, func.comment, "Allocate memory for a new row; Copy var-len portion from $varfld.");
@@ -206,7 +212,7 @@ void amc::tfunc_Pool_AllocVarlen() {
algo_lib::Replscope &R = amc::_db.genctx.R;
amc::FField &field = *amc::_db.genctx.p_field;
amc::FCtype& fldtype = *field.p_arg;
- if (fldtype.c_varlenfld) {
+ if (zd_varlenfld_First(fldtype)) {
amc::FFunc& func = amc::CreateCurFunc();
func.inl=true;
Ins(&R, func.ret , "$Cpptype&", false);
@@ -352,8 +358,8 @@ static tempstr TotlenExpr(algo_lib::Replscope &R, amc::FCtype *ctype, strptr nam
tempstr ret;
if (ctype->c_lenfld) {
ret << amc::LengthExpr(*ctype, name);
- } else if (ctype->c_varlenfld) {
- Set(R, "$vartype", ctype->c_varlenfld->cpp_type);
+ } else if (zd_varlenfld_First(*ctype)) {
+ Set(R, "$vartype", zd_varlenfld_First(*ctype)->cpp_type);
ret << "sizeof($Cpptype) + $varfld_N("<size);
Set(R, "$Type", ctype.cpp_type);
Set(R, "$Ctype", ctype.ctype);
@@ -61,7 +61,7 @@ static void OffsetCheck(algo_lib::Replscope &R, amc::FField &field, int field_id
Ins(&R, text, "// check that bitfield fits width");
Ins(&R, text, "algo_assert(sizeof((($Type*)0)->$fld$suffix)*8 >= $bitwidth);");
}
- bool is_val = !field.c_inlary && &field != field.p_ctype->c_varlenfld;
+ bool is_val = !field.c_inlary && !ctype_zd_varlenfld_InLlistQ(field);
bool needcheck = field_idx == c_datafld_N(ctype)-1
&& ctype.c_pack
&& name_Get(field).n_ch > 0
@@ -97,7 +97,7 @@ void amc::tfunc_Ns_StaticCheck() {
}
}ind_end;
ind_beg(amc::ctype_c_field_curs, field,ctype) if (field.c_fldoffset) {
- if (name_Get(field).n_ch > 0 && !FixaryQ(field) && &field != field.p_ctype->c_varlenfld) {
+ if (name_Get(field).n_ch > 0 && !FixaryQ(field) && !ctype_zd_varlenfld_InLlistQ(field)) {
Set(R, "$Type", amc::NsToCpp(ctype_Get(field)));
Set(R, "$offset", tempstr() << field.c_fldoffset->offset);
Set(R, "$fld", name_Get(field));
diff --git a/cpp/amc/ptr.cpp b/cpp/amc/ptr.cpp
index 262b1eea..c0039630 100644
--- a/cpp/amc/ptr.cpp
+++ b/cpp/amc/ptr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
diff --git a/cpp/amc/ptrary.cpp b/cpp/amc/ptrary.cpp
index 41f03075..a9122600 100644
--- a/cpp/amc/ptrary.cpp
+++ b/cpp/amc/ptrary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
@@ -35,8 +35,13 @@ void amc::tclass_Ptrary() {
InsVar(R, field.p_ctype, "u32", "$name_max", "", "capacity of allocated array");
amc::FPtrary &ptrary = *field.c_ptrary;
- if (ptrary.p_field->c_cascdel && !ptrary.unique) {
- amccheck(0,"amc.explicit_multi_delete"
+ if (ptrary.heaplike) {
+ amccheck(ptrary.unique,"amc.heaplike"
+ <c_cascdel) {
+ amccheck(ptrary.unique,"amc.explicit_multi_delete"
<= 0; i--) {");
Ins(&R, cascdel.body, " $Cpptype &row = *$parname.$name_elems[i];");
- if (ptrary.unique) {
- Ins(&R, cascdel.body, " row.$parname_$name_in_ary = false;");
+ if (ptrary.heaplike) {
+ Ins(&R, cascdel.body, " row.$xfname_idx = -1;");
+ } else if (ptrary.unique) {
+ Ins(&R, cascdel.body, " row.$xfname_in_ary = false;");
}
Ins(&R, cascdel.body, DeleteExpr(field,"$pararg","row")<<";");
Ins(&R, cascdel.body , "}");
@@ -95,12 +102,12 @@ void amc::tfunc_Ptrary_InAryQ() {
if (ptrary.unique) {
amc::FFunc& inary = amc::CreateCurFunc();
Ins(&R, inary.ret , "bool", false);
- if (amc::GlobalQ(*field.p_ctype)) {
- Ins(&R, inary.proto, "$name_InAryQ($Cpptype& row)", false);
+ Ins(&R, inary.proto, "$xfname_InAryQ($Cpptype& row)", false);
+ if (ptrary.heaplike) {
+ Ins(&R, inary.body, "return row.$xfname_idx != -1;");
} else {
- Ins(&R, inary.proto, "$parname_$name_InAryQ($Cpptype& row)", false);
+ Ins(&R, inary.body, "return row.$xfname_in_ary;");
}
- Ins(&R, inary.body, "return row.$parname_$name_in_ary;");
}
}
@@ -148,28 +155,30 @@ void amc::tfunc_Ptrary_Insert() {
tempstr text;
- Ins(&R, text, "// reserve space");
- Ins(&R, text, "$name_Reserve($pararg, 1);");
- // - find insert point
- Ins(&R, text, "u32 n = $parname.$name_n;");
- Ins(&R, text, "u32 at = n;");
- Ins(&R, text, "$Cpptype* *elems = $parname.$name_elems;");
- // actual insertion
- Ins(&R, text, "elems[at] = &row;");
- Ins(&R, text, "$parname.$name_n = n+1;");
-
// function body
amc::FFunc& insert = amc::CreateCurFunc();
Ins(&R, insert.ret , "void", false);
Ins(&R, insert.comment, "Insert pointer to row into array. Row must not already be in array.");
Ins(&R, insert.comment, "If pointer is already in the array, it may be inserted twice.");//TODO UPDATE ME
Ins(&R, insert.proto, "$name_Insert($Parent, $Cpptype& row)", false);
- if (ptrary.unique) {
- Ins(&R, insert.body, "if (bool_Update(row.$parname_$name_in_ary,true)) {");
- insert.body << text << eol;
+ if (ptrary.heaplike) {
+ Ins(&R, insert.body, "if (row.$xfname_idx == -1) {");
+ Ins(&R, insert.body, " $name_Reserve($pararg, 1);");
+ Ins(&R, insert.body, " u32 n = $parname.$name_n++;");
+ Ins(&R, insert.body, " $parname.$name_elems[n] = &row;");
+ Ins(&R, insert.body, " row.$xfname_idx = n;");
+ Ins(&R, insert.body, "}");
+ } else if (ptrary.unique) {
+ Ins(&R, insert.body, "if (!row.$xfname_in_ary) {");
+ Ins(&R, insert.body, " $name_Reserve($pararg, 1);");
+ Ins(&R, insert.body, " u32 n = $parname.$name_n++;");
+ Ins(&R, insert.body, " $parname.$name_elems[n] = &row;");
+ Ins(&R, insert.body, " row.$xfname_in_ary = true;");
Ins(&R, insert.body, "}");
} else {
- insert.body << text << eol;
+ Ins(&R, insert.body, "$name_Reserve($pararg, 1);");
+ Ins(&R, insert.body, "u32 n = $parname.$name_n++;");
+ Ins(&R, insert.body, "$parname.$name_elems[n] = &row;");
}
}
@@ -186,7 +195,7 @@ void amc::tfunc_Ptrary_InsertMaybe() {
Ins(&R, insmaybe.comment, "Insert pointer to row in array.");
Ins(&R, insmaybe.comment, "If row is already in the array, do nothing.");
Ins(&R, insmaybe.comment, "Return value: whether element was inserted into array.");
- Ins(&R, insmaybe.body, "bool retval = !row.$parname_$name_in_ary;");
+ Ins(&R, insmaybe.body, "bool retval = !$xfname_InAryQ(row);");
Ins(&R, insmaybe.body, "$name_Insert($pararg,row); // check is performed in _Insert again");
Ins(&R, insmaybe.body, "return retval;");
}
@@ -241,31 +250,114 @@ void amc::tfunc_Ptrary_Remove() {
amc::FField &field = *amc::_db.genctx.p_field;
amc::FPtrary &ptrary = *field.c_ptrary;
- tempstr text;
- Ins(&R, text, "int lim = $parname.$name_n;");
- Ins(&R, text, "$Cpptype* *elems = $parname.$name_elems;");
- Ins(&R, text, "// search backward, so that most recently added element is found first.");
- Ins(&R, text, "// if found, shift array.");
- Ins(&R, text, "for (int i = lim-1; i>=0; i--) {");
- Ins(&R, text, " $Cpptype* elem = elems[i]; // fetch element");
- Ins(&R, text, " if (elem == &row) {");
- Ins(&R, text, " int j = i + 1;");
- Ins(&R, text, " size_t nbytes = sizeof($Cpptype*) * (lim - j);");
- Ins(&R, text, " memmove(elems + i, elems + j, nbytes);");
- Ins(&R, text, " $parname.$name_n = lim - 1;");
- Ins(&R, text, " break;");
- Ins(&R, text, " }");
- Ins(&R, text, "}");
-
amc::FFunc& rem = amc::CreateCurFunc();
Ins(&R, rem.ret , "void", false);
Ins(&R, rem.proto , "$name_Remove($Parent, $Cpptype& row)", false);
- if (ptrary.unique) {
- Ins(&R, rem.body, "if (bool_Update(row.$parname_$name_in_ary,false)) {");
- rem.body << text;
+ Ins(&R, rem.body, "int n = $parname.$name_n;");
+ if (ptrary.heaplike) {
+ // heap-like removal
+ Ins(&R, rem.body, "int idx = row.$xfname_idx;");
+ Ins(&R, rem.body, "if (idx != -1) {");
+ Ins(&R, rem.body, " $Cpptype *last = $parname.$name_elems[n-1];");
+ Ins(&R, rem.body, " last->$xfname_idx = idx;");
+ Ins(&R, rem.body, " $parname.$name_elems[idx] = last;");
+ Ins(&R, rem.body, " row.$xfname_idx = -1;");
+ Ins(&R, rem.body, " $parname.$name_n = n - 1;");
+ Ins(&R, rem.body, "}");
+ } else if (ptrary.unique) {
+ // removal of single element through scanning
+ Ins(&R, rem.body, "if (bool_Update(row.$xfname_in_ary,false)) {");
+ Ins(&R, rem.body, " $Cpptype* *elems = $parname.$name_elems;");
+ Ins(&R, rem.body, " // search backward, so that most recently added element is found first.");
+ Ins(&R, rem.body, " // if found, shift array.");
+ Ins(&R, rem.body, " for (int i = n-1; i>=0; i--) {");
+ Ins(&R, rem.body, " $Cpptype* elem = elems[i]; // fetch element");
+ Ins(&R, rem.body, " if (elem == &row) {");
+ Ins(&R, rem.body, " int j = i + 1;");
+ Ins(&R, rem.body, " size_t nbytes = sizeof($Cpptype*) * (n - j);");
+ Ins(&R, rem.body, " memmove(elems + i, elems + j, nbytes);");
+ Ins(&R, rem.body, " $parname.$name_n = n - 1;");
+ Ins(&R, rem.body, " break;");
+ Ins(&R, rem.body, " }");
+ Ins(&R, rem.body, " }");
Ins(&R, rem.body, "}");
} else {
- rem.body << text;
+ // element may appear multiple times in a non-unique index
+ Ins(&R, rem.body, "int j=0;");
+ Ins(&R, rem.body, "for (int i=0; i 0) {");
+ Ins(&R, func.body, " row = $parname.$name_elems[0];");
+ Ins(&R, func.body, " row->$xfname_idx=-1;");
+ Ins(&R, func.body, " $parname.$name_elems[n-1]->$xfname_idx=0;");
+ Ins(&R, func.body, " $parname.$name_elems[0]=$parname.$name_elems[n-1];");
+ Ins(&R, func.body, " $parname.$name_n = n-1;");
+ Ins(&R, func.body, "}");
+ Ins(&R, func.body, "return row;");
+ }
+}
+
+void amc::tfunc_Ptrary_First() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FPtrary &ptrary = *field.c_ptrary;
+ if (ptrary.heaplike) {
+ amc::FFunc& func = amc::CreateCurFunc(true);
+ AddRetval(func,Subst(R,"$Cpptype*"),"row","NULL");
+ Ins(&R, func.body, "row = $parname.$name_n ? $parname.$name_elems[0] : NULL;");
+ }
+}
+
+void amc::tfunc_Ptrary_RemoveLast() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FPtrary &ptrary = *field.c_ptrary;
+ if (ptrary.heaplike) {
+ amc::FFunc& func = amc::CreateCurFunc();
+ Ins(&R, func.comment, "If index is empty, return NULL. Otherwise remove and return last element in index.");
+ Ins(&R, func.ret , "$Cpptype*", false);
+ Ins(&R, func.proto, "$name_RemoveLast($Parent)", false);
+ Ins(&R, func.body, "$Cpptype *row = NULL;");
+ Ins(&R, func.body, "int n = $parname.$name_n;");
+ Ins(&R, func.body, "if (n > 0) {");
+ Ins(&R, func.body, " row = $parname.$name_elems[n-1];");
+ Ins(&R, func.body, " row->$xfname_idx=-1;");
+ Ins(&R, func.body, " $parname.$name_n = n-1;");
+ Ins(&R, func.body, "}");
+ Ins(&R, func.body, "return row;");
+ }
+}
+
+void amc::tfunc_Ptrary_Last() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FPtrary &ptrary = *field.c_ptrary;
+ if (ptrary.heaplike) {
+ amc::FFunc& func = amc::CreateCurFunc(true);
+ AddRetval(func,Subst(R,"$Cpptype*"),"row","NULL");
+ Ins(&R, func.body, "row = $parname.$name_n ? $parname.$name_elems[$parname.$name_n-1] : NULL;");
}
}
@@ -278,10 +370,14 @@ void amc::tfunc_Ptrary_RemoveAll() {
removeall.inl = true;
Ins(&R, removeall.ret , "void", false);
Ins(&R, removeall.proto, "$name_RemoveAll($Parent)", false);
- if (ptrary.unique) {
+ if (ptrary.heaplike) {
+ Ins(&R, removeall.body, "for (u32 i = 0; i < $parname.$name_n; i++) {");
+ Ins(&R, removeall.body, " $parname.$name_elems[i]->$xfname_idx = -1;");
+ Ins(&R, removeall.body, "}");
+ } else if (ptrary.unique) {
Ins(&R, removeall.body, "for (u32 i = 0; i < $parname.$name_n; i++) {");
Ins(&R, removeall.body, " // mark all elements as not-in-array");
- Ins(&R, removeall.body, " $parname.$name_elems[i]->$parname_$name_in_ary = false;");
+ Ins(&R, removeall.body, " $parname.$name_elems[i]->$xfname_in_ary = false;");
Ins(&R, removeall.body, "}");
}
Ins(&R, removeall.body, "$parname.$name_n = 0;");
@@ -355,8 +451,12 @@ void amc::Ptrary_curs(bool once) {
Ins(&R, func.comment, "proceed to next item");
Ins(&R, func.ret , "void", false);
Ins(&R, func.proto, "$Parname_$name_$curstype_Next($Parname_$name_$curstype &curs)", false);
- if (once && ptrary.unique) {
- Ins(&R, func.body, " curs.elems[curs.index]->$parname_$name_in_ary = false;");
+ if (once) {
+ if (ptrary.heaplike) {
+ Ins(&R, func.body, " curs.elems[curs.index]->$xfname_idx = -1;");
+ } else if (ptrary.unique) {
+ Ins(&R, func.body, " curs.elems[curs.index]->$xfname_in_ary = false;");
+ }
}
Ins(&R, func.body, "curs.index++;");
}
diff --git a/cpp/amc/query.cpp b/cpp/amc/query.cpp
index bd8fa9cd..ec7ac1e1 100644
--- a/cpp/amc/query.cpp
+++ b/cpp/amc/query.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -63,7 +63,7 @@ static void Query_Func(algo_lib::Regx ®x, cstring &out) {
if (amc::_db.cmdline.proto || func.extrn || func.deleted) {
amc::_db.report.n_func++;
tempstr proto;
- PrintFuncProto(func, NULL, proto);
+ PrintFuncProto(func, NULL, proto,true);
algo::InsertIndent(*ns.hdr, proto, 0);
} else {
amc::_db.report.n_func++;
@@ -86,16 +86,19 @@ static void Query_Func(algo_lib::Regx ®x, cstring &out) {
// -----------------------------------------------------------------------------
void amc::Main_Querymode() {
+ strptr key = Pathcomp(amc::_db.cmdline.query, ":RL");
tempstr value(algo::Pathcomp(amc::_db.cmdline.query, ":RR"));
+ if (key == "") {
+ key = "%";
+ }
if (value == "") {
value = "%";
- } else if (FindStr(value, ".")==-1) {
+ } else if (FindStr(value, ".")==-1) { // -> .%
value << ".%";
}
- strptr key = Pathcomp(amc::_db.cmdline.query, ":RL");
- if (key == "") {
- key = "%";
- }
+ verblog("amc.query"
+ <field;
step.extrn=true;
}
@@ -80,37 +124,16 @@ void amc::tfunc_Step_Init() {
Set(R, "$delay", tempstr()<< fstep.c_fdelay->delay);
Ins(&R, init.body, "$ns::_db.th_$name.delay = algo::ToSchedTime($delay); // initialize fstep delay ($field)");
}
+ } else if (fstep.steptype == dmmeta_Steptype_steptype_TimeHookOnce) {
+ Ins(&R, init.body, "// initialize fstep timehook ($field)");
+ Ins(&R, init.body, "hook_Set0($parname.th_$name, $ns::$name_Call);");
+ vrfy(!fstep.c_fdelay, tempstr()
+ <<"fdelay is not applicable to Once steps");
}
}
// -----------------------------------------------------------------------------
-static void GenInlineRecur(algo_lib::Replscope &R, amc::FField &field, amc::FFunc& call) {
- amc::FFstep &fstep = *field.c_fstep;
- InsVar(R, field.p_ctype, "algo::SchedTime", "$name_next", "", "$field \tNext invocation time");
- InsVar(R, field.p_ctype, "algo::SchedTime", "$name_delay", "", "$field \tDelay between invocations");
-
- if (fstep.c_fdelay) {
- Set(R, "$delay", tempstr()<< value_GetDouble(fstep.c_fdelay->delay));
- }
-
- Ins(&R, call.body, "if ($LoopCond) { // fstep:$field");
- Ins(&R, call.body, " if ($ns::_db.$name_next < algo_lib::_db.clock) {");
- if (fstep.c_fdelay && fstep.c_fdelay->scale) {
- Ins(&R, call.body, " u64 effective_delay = $ns::_db.$name_delay / u64_Max(1,$ns::$name_N());");
- Ins(&R, call.body, " $ns::_db.$name_next = algo_lib::_db.clock + algo::SchedTime(effective_delay);");
- } else {
- Ins(&R, call.body, " $ns::_db.$name_next = algo_lib::_db.clock + $ns::_db.$name_delay;");
- }
- Ins(&R, call.body, " $ns::$name_Step(); // steptype:InlineRecur: call function every N clock cycles");
- Ins(&R, call.body, " $name_UpdateCycles();");
- Ins(&R, call.body, " }");
- Ins(&R, call.body, " algo_lib::_db.next_loop.value = u64_Min($ns::_db.$name_next, algo_lib::_db.next_loop);");
- Ins(&R, call.body, "}");
-}
-
-// -----------------------------------------------------------------------------
-
static tempstr GetStepCond(amc::FField &field, amc::FFstep &fstep) {
tempstr ret;
// special work-around for ZSListMT -- EmptyQ cannot be defined, DestructiveFirst must be used.
@@ -148,25 +171,50 @@ void amc::tfunc_Step_Call() {
Set(R, "$LoopCond", GetStepCond(field,fstep));
vrfy(!(fstep.steptype == dmmeta_Steptype_steptype_InlineOnce)
- || field.reftype == dmmeta_Reftype_reftype_Bheap, "TimeHookOnce requires bheap");
+ || field.reftype == dmmeta_Reftype_reftype_Bheap, "InlineOnce requires bheap");
vrfy(!fstep.c_fdelay || (fstep.steptype == dmmeta_Steptype_steptype_InlineRecur
|| fstep.steptype == dmmeta_Steptype_steptype_TimeHookRecur)
, "fdelay only applies to step type InlineRecur and TimeHookRecur");
if (fstep.steptype == dmmeta_Steptype_steptype_InlineRecur) {
- GenInlineRecur(R, field, call);
- } else if (fstep.steptype == dmmeta_Steptype_steptype_InlineOnce) {
+ if (fstep.c_fdelay) {
+ Set(R, "$delay", tempstr()<< value_GetDouble(fstep.c_fdelay->delay));
+ }
+
+ Ins(&R, call.body, "if ($LoopCond) { // fstep:$field");
+ Ins(&R, call.body, " if ($ns::_db.$name_next < algo_lib::_db.clock) {");
+ if (fstep.c_fdelay && fstep.c_fdelay->scale) {
+ Ins(&R, call.body, " u64 effective_delay = $ns::_db.$name_delay / u64_Max(1,$ns::$name_N());");
+ Ins(&R, call.body, " $ns::_db.$name_next = algo_lib::_db.clock + algo::SchedTime(effective_delay);");
+ } else {
+ Ins(&R, call.body, " $ns::_db.$name_next = algo_lib::_db.clock + $ns::_db.$name_delay;");
+ }
+ Ins(&R, call.body, " $ns::$name_Step(); // steptype:InlineRecur: call function every N clock cycles");
+ Ins(&R, call.body, " $name_UpdateCycles();");
+ Ins(&R, call.body, " }");
+ Ins(&R, call.body, " algo_lib::_db.next_loop.value = u64_Min($ns::_db.$name_next, algo_lib::_db.next_loop);");
+ Ins(&R, call.body, "}");
+ } else if (fstep.steptype == dmmeta_Steptype_steptype_InlineOnce || fstep.steptype == dmmeta_Steptype_steptype_TimeHookOnce) {
Set(R, "$sortval" , FieldvalExpr(field.p_arg, *field.c_sortfld->p_sortfld, "(*$name)"));
Set(R, "$Cpptype" , field.p_arg->cpp_type);
- Ins(&R, call.body, "if ($Cpptype *$name = $ns::$name_First()) { // fstep:$field");
+ Ins(&R, call.body, "// Call Step for all entries expired by this time.");
+ Ins(&R, call.body, "// (_db.clock may get updated during this loop, but only those entries");
+ Ins(&R, call.body, "// that expired prior will be processed.)");
+ Ins(&R, call.body, "algo_lib::_db.step_limit = algo_lib::_db.clock;");
+ Ins(&R, call.body, "while ($Cpptype *$name = $ns::$name_First()) { // fstep:$field");
Ins(&R, call.body, " algo::SchedTime expire = $sortval;");
- Ins(&R, call.body, " // if step occurs, next cycle comes with no delay.");
- Ins(&R, call.body, " // if step isn't occuring yet, calculate delay.");
- Ins(&R, call.body, " if (expire < algo_lib::_db.clock) {");
+ Ins(&R, call.body, " if (expire < algo_lib::_db.step_limit) {");
Ins(&R, call.body, " $ns::$name_Step(); // steptype:InlineOnce: call function at specified time");
Ins(&R, call.body, " $name_UpdateCycles();");
+ if (fstep.steptype == dmmeta_Steptype_steptype_InlineOnce) {
+ Ins(&R, call.body, " algo_lib::_db.next_loop.value = algo_lib::_db.step_limit;");
+ }
+ Ins(&R, call.body, " } else {");
+ if (fstep.steptype == dmmeta_Steptype_steptype_InlineOnce) {
+ Ins(&R, call.body, " algo_lib::_db.next_loop.value = u64_Min(expire, algo_lib::_db.next_loop);");
+ }
+ Ins(&R, call.body, " break;");
Ins(&R, call.body, " }");
- Ins(&R, call.body, " algo_lib::_db.next_loop.value = u64_Min(expire, algo_lib::_db.next_loop);");
Ins(&R, call.body, "}");
} else if (fstep.steptype == dmmeta_Steptype_steptype_Inline) {
Ins(&R, call.body, "if ($LoopCond) { // fstep:$field");
@@ -179,7 +227,6 @@ void amc::tfunc_Step_Call() {
Ins(&R, call.body, " $ns::$name_Step(); // steptype:Callback: user calls call _UpdateCycles");
Ins(&R, call.body, "}");
} else if (fstep.steptype == dmmeta_Steptype_steptype_TimeHookRecur) {
- InsVar(R, field.p_ctype, "algo_lib::FTimehook", "th_$name", "", "$field \tfstep time hook for $field");
Ins(&R, call.body , "$ns::$name_Step();");
Ins(&R, call.body , "$name_UpdateCycles();");
} else if (fstep.steptype == dmmeta_Steptype_steptype_Extern) {
@@ -215,6 +262,17 @@ void amc::tfunc_Step_FirstChanged() {
Ins(&R, chg.body, "} else {");
Ins(&R, chg.body, " bh_timehook_Remove($parname.th_$name);");
Ins(&R, chg.body, "}");
+ } else if (fstep.steptype == dmmeta_Steptype_steptype_TimeHookOnce) {
+ chg.priv = true;
+ Ins(&R, chg.body, "$Ctype* row = $name_First($pararg);");
+ Ins(&R, chg.comment, "If index $name is empty, deschedule time hook $parname.th_$name.");
+ Ins(&R, chg.comment, "If index is non-empty, update time hook to fire at specified time.");
+ Ins(&R, chg.body, "if (row) {");
+ Ins(&R, chg.body, " $parname.th_$name.time = row->$sortfld;");
+ Ins(&R, chg.body, " bh_timehook_Reheap($parname.th_$name); // ($field) TimeHookOnce");
+ Ins(&R, chg.body, "} else {");
+ Ins(&R, chg.body, " bh_timehook_Remove($parname.th_$name);");
+ Ins(&R, chg.body, "}");
} else if (is_extern) {
Ins(&R, chg.comment, "Forward-declaration for user-provided function.");
} else if (fstep.steptype == dmmeta_Steptype_steptype_Inline) {
diff --git a/cpp/amc/struct.cpp b/cpp/amc/struct.cpp
index 85cdc410..9b0f98c1 100644
--- a/cpp/amc/struct.cpp
+++ b/cpp/amc/struct.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2016-2019 NYSE | Intercontinental Exchange
//
@@ -34,7 +34,7 @@ bool amc::PassFieldViaArgQ(amc::FField &field, amc::FCtype &ctype) {
&& !(field.c_typefld && ctype.c_msgtype)
&& !(GetLenfld(field) && ctype.c_msgtype)
&& !FldfuncQ(field)
- && (&field != ctype.c_varlenfld);// stack constructor doesn't accept varlen or optional fields
+ && !ctype_zd_varlenfld_InLlistQ(field);// stack constructor doesn't accept varlen or optional fields
return ok;
}
@@ -98,7 +98,7 @@ static void GenStruct_Ctor2(algo_lib::Replscope &R, amc::FCtype &ctype) {
Ins(&R, *ns.hdr, (cur_priv ? "private:" : "public:"));
}
tempstr proto;
- PrintFuncProto(func,&ctype,proto);
+ PrintFuncProto(func,&ctype,proto,false);
algo::InsertIndent(*ns.hdr, proto,1);
}ind_end;
}ind_end;
@@ -110,7 +110,7 @@ static void GenStruct_Ctor2(algo_lib::Replscope &R, amc::FCtype &ctype) {
Ins(&R, *ns.hdr, (cur_priv ? "private:" : "public:"));
}
tempstr proto;
- PrintFuncProto(func,&ctype,proto);
+ PrintFuncProto(func,&ctype,proto,false);
algo::InsertIndent(*ns.hdr,proto,1);
}ind_end;
}
@@ -122,7 +122,7 @@ static void GenStruct_Ctor2(algo_lib::Replscope &R, amc::FCtype &ctype) {
Ins(&R, *ns.hdr, (cur_priv ? "private:" : "public:"));
}
tempstr proto;
- PrintFuncProto(func,&ctype,proto);
+ PrintFuncProto(func,&ctype,proto,false);
algo::InsertIndent(*ns.hdr,proto,1);
}ind_end;
}ind_end;
diff --git a/cpp/amc/substr.cpp b/cpp/amc/substr.cpp
index fd82d367..b4943c48 100644
--- a/cpp/amc/substr.cpp
+++ b/cpp/amc/substr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/tableid.cpp b/cpp/amc/tableid.cpp
index d5ae40b0..889a8933 100644
--- a/cpp/amc/tableid.cpp
+++ b/cpp/amc/tableid.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
// License: GPL
diff --git a/cpp/amc/tary.cpp b/cpp/amc/tary.cpp
index d4e7c0eb..54f2ca5f 100644
--- a/cpp/amc/tary.cpp
+++ b/cpp/amc/tary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -180,6 +180,40 @@ void amc::tfunc_Tary_AllocN() {
}
}
+void amc::tfunc_Tary_AllocNAt() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ bool can_memset = field.arg == "char" || field.arg == "u8";
+
+ {
+ amc::FFunc& allocnat = amc::CreateCurFunc();
+ Ins(&R, allocnat.comment, "Reserve space for new element, reallocating the array if necessary");
+ Ins(&R, allocnat.comment, "Insert new element at specified index. Index must be in range or a fatal error occurs.", false);
+ Ins(&R, allocnat.ret , "algo::aryptr<$Cpptype>", false);
+ Ins(&R, allocnat.proto, "$name_AllocNAt($Parent, int n_elems, int at)", false);
+ Ins(&R, allocnat.body , "$name_Reserve($pararg, n_elems);");
+ Ins(&R, allocnat.body , "int n = $parname.$name_n;");
+ Ins(&R, allocnat.body , "if (UNLIKELY(u64(at) > u64(n))) {");// silently cure bad index?
+ Ins(&R, allocnat.body , " FatalErrorExit(\"$ns.bad_alloc_n_at field:$field comment:'index out of range'\");");
+ Ins(&R, allocnat.body , "}");
+ Ins(&R, allocnat.body , "$Cpptype *elems = $parname.$name_elems;");
+ Ins(&R, allocnat.body , "memmove(elems + at + n_elems, elems + at, (n - at) * sizeof($Cpptype));");
+ if (can_memset) {
+ Ins(&R, allocnat.body, "memset(elems + at, $dflt, n_elems); // initialize new space");
+ } else {
+ Ins(&R, allocnat.body, "for (int i = 0; i < n_elems; i++) {");
+ Ins(&R, allocnat.body, " new (elems + at + i) $Cpptype($dflt); // construct new element, default initialize");
+ Ins(&R, allocnat.body, "}");
+ }
+ Ins(&R, allocnat.body , "$parname.$name_n = n+n_elems;");
+ if (field.do_trace) {
+ Set(R, "$partrace", Refname(*field.p_ctype));
+ Ins(&R, allocnat.body, "$ns::_db.trace.alloc_$partrace_$name += n_elems;");
+ }
+ Ins(&R, allocnat.body , "return algo::aryptr<$Cpptype>(elems+at,n_elems);");
+ }
+}
+
// -----------------------------------------------------------------------------
void amc::tfunc_Tary_AllocNVal() {
@@ -717,3 +751,54 @@ void amc::tfunc_Tary_CtorAryptr() {
Ins(&R, func.body, "$name_Addary(*this, rhs);");
}
}
+
+// -----------------------------------------------------------------------------
+
+void amc::tfunc_Tary_Insary() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ bool can_copy = !CopyPrivQ(*field.p_arg);
+ bool can_memcpy = field.p_arg->c_bltin;
+ bool dtor = (field.p_arg->c_cpptype && field.p_arg->c_cpptype->dtor)||!field.p_arg->c_cpptype;
+
+ if (field.p_arg->n_xref == 0 && can_copy) {
+ amc::FFunc& insary = amc::CreateCurFunc();
+ Ins(&R, insary.comment, "Insert N elements at specified index. Index must be in range or a fatal error occurs.", false);
+ Ins(&R, insary.comment, "Reserve space, and move existing elements to end.", false);
+ Ins(&R, insary.comment, "If the RHS argument aliases the array (refers to the same memory), exit program with fatal error.");
+ Ins(&R, insary.proto, "$name_Insary($Parent, algo::aryptr<$Cpptype> rhs, int at)", false);
+ Ins(&R, insary.ret , "void", false);
+ Ins(&R, insary.body , "bool overlaps = rhs.n_elems>0 && rhs.elems >= $parname.$name_elems && rhs.elems < $parname.$name_elems + $parname.$name_max;");
+ Ins(&R, insary.body , "if (UNLIKELY(overlaps)) {");
+ Ins(&R, insary.body , " FatalErrorExit(\"$ns.tary_alias field:$field comment:'alias error: sub-array is being appended to the whole'\");");
+ Ins(&R, insary.body , "}");
+ Ins(&R, insary.body , "if (UNLIKELY(u64(at) >= u64($parname.$name_elems+1))) {");
+ Ins(&R, insary.body , " FatalErrorExit(\"$ns.bad_insary field:$field comment:'index out of range'\");");
+ Ins(&R, insary.body , "}");
+ Ins(&R, insary.body , "int nnew = rhs.n_elems;");
+ Ins(&R, insary.body , "int nmove = $parname.$name_n - at;");
+ Ins(&R, insary.body , "$name_Reserve($pararg, nnew); // reserve space");
+ if (can_memcpy) {
+ Ins(&R, insary.body, "memmove($parname.$name_elems + at + nnew, $parname.$name_elems + at, nmove * sizeof($Cpptype));");
+ Ins(&R, insary.body, "memcpy($parname.$name_elems + at, rhs.elems, nnew * sizeof($Cpptype));");
+ Ins(&R, insary.body, "$parname.$name_n += nnew;");
+ } else {
+ // copy one by one -- if exception thrown during copying, $name_n will contain
+ // a valid value.
+ Ins(&R, insary.body, "for (int i = nmove-1; i >=0 ; --i) {");
+ Ins(&R, insary.body, " new ($parname.$name_elems + at + nnew + i) $Cpptype($parname.$name_elems[at + i]);");
+ if (dtor) {
+ Ins(&R, insary.body, " $parname.$name_elems[at + i].~$Ctype(); // destroy element");
+ }
+ Ins(&R, insary.body, "}");
+ Ins(&R, insary.body, "for (int i = 0; i < nnew; ++i) {");
+ Ins(&R, insary.body, " new ($parname.$name_elems + at + i) $Cpptype(rhs[i]);");
+ Ins(&R, insary.body, "}");
+ Ins(&R, insary.body, "$parname.$name_n += nnew;");
+ }
+ if (field.do_trace) {
+ Set(R, "$partrace", Refname(*field.p_ctype));
+ Ins(&R, insary.body, "$ns::_db.trace.alloc_$partrace_$name += nnew;");
+ }
+ }
+}
diff --git a/cpp/amc/tclass.cpp b/cpp/amc/tclass.cpp
index 0f690f36..aa47beaa 100644
--- a/cpp/amc/tclass.cpp
+++ b/cpp/amc/tclass.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -30,7 +30,7 @@ void amc::ResetVars(amc::Genctx &ctx) {
amc::FNs &ns = *ctx.p_ns;
amc::FCtype *parent = ctx.p_ctype;
amc::FField *field = ctx.p_field;
- ind_replvar_Cascdel(R);
+ ind_replvar_Cascdel(R);// clean out varsx
Set(R, "$ns", ns.ns);
if (parent) {
@@ -49,6 +49,7 @@ void amc::ResetVars(amc::Genctx &ctx) {
if (field) {
Set(R, "$field" , field->field);
Set(R, "$name" , name_Get(*field));
+ Set(R, "$xfname" , glob ? "$name" : "$parname_$name");// prefix for fields added to child record - must include parent name for disambiguation
Set(R, "$Cpptype" , field->p_arg->cpp_type);
Set(R, "$Ctype" , name_Get(*field->p_arg));
if (field->p_reftype->usebasepool) {
@@ -175,7 +176,7 @@ static void GenTclass_Field(amc::FField &field) {
// (template class, no relation to C++ notion of template or class)
// based on its type and associated records, and each tclass generates zero or more tfuncs
void amc::gen_ns_tclass_field() {
- ind_beg(amc::_db_ns_curs, ns, amc::_db) if (ns.select) {
+ ind_beg(amc::_db_ns_curs, ns, amc::_db) if (ns.c_nscpp) {
amc::_db.genctx.p_ns = &ns;
amc::BeginNsBlock(*ns.hdr, ns, "");
ind_beg(amc::ns_c_ctype_curs, ctype,ns) {
@@ -215,12 +216,9 @@ void amc::gen_ns_tclass_ctype() {
// -----------------------------------------------------------------------------
void amc::gen_ns_tclass_ns() {
- amc::FNs &ns =*amc::_db.c_ns;
amc::_db.genctx.p_ns = amc::_db.c_ns;
amc::_db.genctx.p_ctype = NULL;
amc::_db.genctx.p_field = NULL;
- if (ns.ns != "") {
- ResetVars(amc::_db.genctx);
- GenTclass(amc_tclass_Ns);
- }
+ ResetVars(amc::_db.genctx);
+ GenTclass(amc_tclass_Ns);
}
diff --git a/cpp/amc/thash.cpp b/cpp/amc/thash.cpp
index dd30630b..fce74c64 100644
--- a/cpp/amc/thash.cpp
+++ b/cpp/amc/thash.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
@@ -25,8 +25,25 @@
#include "include/amc.h"
+
// -----------------------------------------------------------------------------
+static bool HashLinearQ() {
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FThash &thash = *field.c_thash;
+ amc::FField *hashfld = thash.p_hashfld;
+ amc::FChash *chash = hashfld->p_arg->c_chash;
+ return chash && chash->hashtype == dmmeta_Hashtype_hashtype_Linear;
+}
+
+static bool HashLinearUniqueQ() {
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FThash &thash = *field.c_thash;
+ amc::FField *hashfld = thash.p_hashfld;
+ amc::FChash *chash = hashfld->p_arg->c_chash;
+ return chash && chash->hashtype == dmmeta_Hashtype_hashtype_Linear && thash.unique;
+}
+
static bool EarlierPoolQ(amc::FField &field, amc::FField &first_inst) {
bool same_scope = field.p_ctype == first_inst.p_ctype;
bool glob = GlobalQ(*field.p_ctype);
@@ -71,7 +88,7 @@ static void Thash_Check(amc::FField &field) {
prlog("dmmeta.thash"
<body, "$fname.$name_next = ($Cpptype*)-1; // ($field) not-in-hash");
+ Ins(&R, child_init->body, "$fname.$xfname_next = ($Cpptype*)-1; // ($field) not-in-hash");
+ Ins(&R, child_init->body, "$fname.$xfname_hashval = 0; // stored hash value");
Thash_Check(field);
}
@@ -109,15 +128,17 @@ void amc::tfunc_Thash_Find() {
amc::FFunc& find = amc::CreateCurFunc();
Ins(&R, find.ret , "$Cpptype*", false);
Ins(&R, find.proto, "$name_Find($Parent, $Hashfldarg key)", false);
- Ins(&R, find.body, "u32 index = $Hashfldtype_Hash(0, key) & ($parname.$name_buckets_n - 1);");
- Ins(&R, find.body, "$Cpptype* *e = &$parname.$name_buckets_elems[index];");
- Ins(&R, find.body, "$Cpptype* ret=NULL;");
- Ins(&R, find.body, "do {");
- Ins(&R, find.body, " ret = *e;");
- Ins(&R, find.body, " bool done = !ret || $rethashfld == key;");
- Ins(&R, find.body, " if (done) break;");
- Ins(&R, find.body, " e = &ret->$name_next;");
- Ins(&R, find.body, "} while (true);");
+ if (HashLinearQ()) {
+ Ins(&R, find.body, "u32 index = key;");
+ Ins(&R, find.body, "$Cpptype *ret = index < u32($parname.$name_buckets_n) ? $parname.$name_buckets_elems[index] : NULL;");
+ } else {
+ Ins(&R, find.body, "u32 index = $Hashfldtype_Hash(0, key) & ($parname.$name_buckets_n - 1);");
+ Ins(&R, find.body, "$Cpptype *ret = $parname.$name_buckets_elems[index];");
+ }
+ if (!HashLinearUniqueQ()) {
+ Ins(&R, find.body, "for (; ret && !($rethashfld == key); ret = ret->$xfname_next) {");
+ Ins(&R, find.body, "}");
+ }
Ins(&R, find.body, "return ret;");
}
@@ -142,34 +163,55 @@ void amc::tfunc_Thash_Reserve() {
amc::FFunc& reserve = amc::CreateCurFunc();
Ins(&R, reserve.ret , "void", false);
Ins(&R, reserve.proto, "$name_Reserve($Parent, int n)", false);
+ Ins(&R, reserve.body, " $name_AbsReserve($pararg,$parname.$name_n + n);");
+}
+
+// -----------------------------------------------------------------------------
+
+void amc::tfunc_Thash_AbsReserve() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+
+ amc::FFunc& reserve = amc::CreateCurFunc();
+ Ins(&R, reserve.ret , "void", false);
+ Ins(&R, reserve.proto, "$name_AbsReserve($Parent, int n)", false);
Ins(&R, reserve.body, "u32 old_nbuckets = $parname.$name_buckets_n;");
- Ins(&R, reserve.body, "u32 new_nelems = $parname.$name_n + n;");
+ Ins(&R, reserve.body, "u32 new_nelems = n;");
Ins(&R, reserve.body, "// # of elements has to be roughly equal to the number of buckets");
Ins(&R, reserve.body, "if (new_nelems > old_nbuckets) {");
Ins(&R, reserve.body, " int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4));");
Ins(&R, reserve.body, " u32 old_size = old_nbuckets * sizeof($Cpptype*);");
Ins(&R, reserve.body, " u32 new_size = new_nbuckets * sizeof($Cpptype*);");
- Ins(&R, reserve.body, " // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably");
- Ins(&R, reserve.body, " // means new memory will have to be allocated anyway");
- Ins(&R, reserve.body, " $Cpptype* *new_buckets = ($Cpptype**)$basepool_AllocMem(new_size);");
- Ins(&R, reserve.body, " if (UNLIKELY(!new_buckets)) {");
- Ins(&R, reserve.body, " FatalErrorExit(\"$ns.out_of_memory field:$field\");");
- Ins(&R, reserve.body, " }");
- Ins(&R, reserve.body, " memset(new_buckets, 0, new_size); // clear pointers");
- Ins(&R, reserve.body, " // rehash all entries");
- Ins(&R, reserve.body, " for (int i = 0; i < $parname.$name_buckets_n; i++) {");
- Ins(&R, reserve.body, " $Cpptype* elem = $parname.$name_buckets_elems[i];");
- Ins(&R, reserve.body, " while (elem) {");
- Ins(&R, reserve.body, " $Cpptype &row = *elem;");
- Ins(&R, reserve.body, " $Cpptype* next = row.$name_next;");
- Ins(&R, reserve.body, " u32 index = $Hashfldtype_Hash(0, $gethashfld) & (new_nbuckets-1);");
- Ins(&R, reserve.body, " row.$name_next = new_buckets[index];");
- Ins(&R, reserve.body, " new_buckets[index] = &row;");
- Ins(&R, reserve.body, " elem = next;");
- Ins(&R, reserve.body, " }");
- Ins(&R, reserve.body, " }");
- Ins(&R, reserve.body, " // free old array");
- Ins(&R, reserve.body, " $basepool_FreeMem($parname.$name_buckets_elems, old_size);");
+ if (HashLinearQ()) {
+ Ins(&R, reserve.body, " // realloc, old entries keep their positions");
+ Ins(&R, reserve.body, " $Cpptype* *new_buckets = ($Cpptype**)$basepool_ReallocMem($parname.$name_buckets_elems, old_size, new_size);");
+ Ins(&R, reserve.body, " if (UNLIKELY(!new_buckets)) {");
+ Ins(&R, reserve.body, " FatalErrorExit(\"$ns.out_of_memory field:$field\");");
+ Ins(&R, reserve.body, " }");
+ Ins(&R, reserve.body, " // clear tail of reallocated space");
+ Ins(&R, reserve.body, " memset(new_buckets+old_nbuckets, 0, new_size-old_size);");
+ } else {
+ Ins(&R, reserve.body, " // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably");
+ Ins(&R, reserve.body, " // means new memory will have to be allocated anyway");
+ Ins(&R, reserve.body, " $Cpptype* *new_buckets = ($Cpptype**)$basepool_AllocMem(new_size);");
+ Ins(&R, reserve.body, " if (UNLIKELY(!new_buckets)) {");
+ Ins(&R, reserve.body, " FatalErrorExit(\"$ns.out_of_memory field:$field\");");
+ Ins(&R, reserve.body, " }");
+ Ins(&R, reserve.body, " memset(new_buckets, 0, new_size); // clear pointers");
+ Ins(&R, reserve.body, " // rehash all entries");
+ Ins(&R, reserve.body, " for (int i = 0; i < $parname.$name_buckets_n; i++) {");
+ Ins(&R, reserve.body, " $Cpptype* elem = $parname.$name_buckets_elems[i];");
+ Ins(&R, reserve.body, " while (elem) {");
+ Ins(&R, reserve.body, " $Cpptype &row = *elem;");
+ Ins(&R, reserve.body, " $Cpptype* next = row.$xfname_next;");
+ Ins(&R, reserve.body, " u32 index = row.$xfname_hashval & (new_nbuckets-1);");
+ Ins(&R, reserve.body, " row.$xfname_next = new_buckets[index];");
+ Ins(&R, reserve.body, " new_buckets[index] = &row;");
+ Ins(&R, reserve.body, " elem = next;");
+ Ins(&R, reserve.body, " }");
+ Ins(&R, reserve.body, " }");
+ Ins(&R, reserve.body, " // free old array");
+ Ins(&R, reserve.body, " $basepool_FreeMem($parname.$name_buckets_elems, old_size);");
+ }
Ins(&R, reserve.body, " $parname.$name_buckets_elems = new_buckets;");
Ins(&R, reserve.body, " $parname.$name_buckets_n = new_nbuckets;");
Ins(&R, reserve.body, "}");
@@ -218,7 +260,7 @@ static bool CanGetOrCreateQ(amc::FField &field) {
n_iffy_path += !ignore && !always_succeeds;
}ind_end;
return n_iffy_path <= max_iffy_path
- && !ctype.c_varlenfld
+ && zd_varlenfld_EmptyQ(ctype)
&& !ctype.c_optfld
&& FirstInst(ctype)!=NULL;
}
@@ -296,10 +338,17 @@ void amc::tfunc_Thash_InsertMaybe() {
Ins(&R, ins.comment, "Insert row into hash table. Return true if row is reachable through the hash after the function completes.");
Ins(&R, ins.ret , "bool", false);
Ins(&R, ins.proto, "$name_InsertMaybe($Parent, $Cpptype& row)", false);
- Ins(&R, ins.body , "$name_Reserve($pararg, 1);");
Ins(&R, ins.body , "bool retval = true; // if already in hash, InsertMaybe returns true");
- Ins(&R, ins.body , "if (LIKELY(row.$name_next == ($Cpptype*)-1)) {// check if in hash already");
- Ins(&R, ins.body , " u32 index = $Hashfldtype_Hash(0, $gethashfld) & ($parname.$name_buckets_n - 1);");
+ Ins(&R, ins.body , "if (LIKELY(row.$xfname_next == ($Cpptype*)-1)) {// check if in hash already");
+ if (HashLinearQ()) {
+ Ins(&R, ins.body , " row.$xfname_hashval = $gethashfld;");
+ Ins(&R, ins.body , " $name_AbsReserve($pararg, row.$xfname_hashval + 1);");
+ Ins(&R, ins.body , " u32 index = row.$xfname_hashval;");
+ } else {
+ Ins(&R, ins.body , " row.$xfname_hashval = $Hashfldtype_Hash(0, $gethashfld);");
+ Ins(&R, ins.body , " $name_Reserve($pararg, 1);");
+ Ins(&R, ins.body , " u32 index = row.$xfname_hashval & ($parname.$name_buckets_n - 1);");
+ }
Ins(&R, ins.body , " $Cpptype* *prev = &$parname.$name_buckets_elems[index];");
if (thash.unique) {
Ins(&R, ins.body, " do {");
@@ -311,11 +360,11 @@ void amc::tfunc_Thash_InsertMaybe() {
Ins(&R, ins.body, " retval = false;");
Ins(&R, ins.body, " break;");
Ins(&R, ins.body, " }");
- Ins(&R, ins.body, " prev = &ret->$name_next;");
+ Ins(&R, ins.body, " prev = &ret->$xfname_next;");
Ins(&R, ins.body, " } while (true);");
}
Ins(&R, ins.body , " if (retval) {");
- Ins(&R, ins.body , " row.$name_next = *prev;");
+ Ins(&R, ins.body , " row.$xfname_next = *prev;");
Ins(&R, ins.body , " $parname.$name_n++;");
Ins(&R, ins.body , " *prev = &row;");
Ins(&R, ins.body , " }");
@@ -333,7 +382,7 @@ void amc::tfunc_Thash_Cascdel() {
Ins(&R, cascdel.body, " for (int i = 0; i < $parname.$name_buckets_n; i++) {");
Ins(&R, cascdel.body, " $Cpptype *elem = $parname.$name_buckets_elems[i];");
Ins(&R, cascdel.body, " while (elem) {");
- Ins(&R, cascdel.body, " $Cpptype *next = elem->$name_next;");
+ Ins(&R, cascdel.body, " $Cpptype *next = elem->$xfname_next;");
Ins(&R, cascdel.body, DeleteExpr(field, "$pararg", "*elem") << ";");
Ins(&R, cascdel.body, " elem = next;");
Ins(&R, cascdel.body, " }");
@@ -348,17 +397,22 @@ void amc::tfunc_Thash_Remove() {
amc::FFunc& rem = amc::CreateCurFunc();
Ins(&R, rem.ret , "void", false);
Ins(&R, rem.proto, "$name_Remove($Parent, $Cpptype& row)", false);
- Ins(&R, rem.body, "if (LIKELY(row.$name_next != ($Cpptype*)-1)) {// check if in hash already");
- Ins(&R, rem.body, " u32 index = $Hashfldtype_Hash(0, $gethashfld) & ($parname.$name_buckets_n - 1);");
- Ins(&R, rem.body, " $Cpptype* *prev = &$parname.$name_buckets_elems[index]; // addr of pointer to current element");
+ Ins(&R, rem.body, "if (LIKELY(row.$xfname_next != ($Cpptype*)-1)) {// check if in hash already");
+ if (HashLinearQ()) {
+ Ins(&R, rem.body, " u32 index = row.$xfname_hashval;");
+ Ins(&R, rem.body, " $Cpptype* *prev = index < u32($parname.$name_buckets_n) ? &$parname.$name_buckets_elems[index] : NULL; // addr of pointer to current element");
+ } else {
+ Ins(&R, rem.body, " u32 index = row.$xfname_hashval & ($parname.$name_buckets_n - 1);");
+ Ins(&R, rem.body, " $Cpptype* *prev = &$parname.$name_buckets_elems[index]; // addr of pointer to current element");
+ }
Ins(&R, rem.body, " while ($Cpptype *next = *prev) { // scan the collision chain for our element");
Ins(&R, rem.body, " if (next == &row) { // found it?");
- Ins(&R, rem.body, " *prev = next->$name_next; // unlink (singly linked list)");
+ Ins(&R, rem.body, " *prev = next->$xfname_next; // unlink (singly linked list)");
Ins(&R, rem.body, " $parname.$name_n--;");
- Ins(&R, rem.body, " row.$name_next = ($Cpptype*)-1;// not-in-hash");
+ Ins(&R, rem.body, " row.$xfname_next = ($Cpptype*)-1;// not-in-hash");
Ins(&R, rem.body, " break;");
Ins(&R, rem.body, " }");
- Ins(&R, rem.body, " prev = &next->$name_next;");
+ Ins(&R, rem.body, " prev = &next->$xfname_next;");
Ins(&R, rem.body, " }");
Ins(&R, rem.body, "}");
}
@@ -371,18 +425,29 @@ void amc::tfunc_Thash_FindRemove() {
amc::FFunc& findrem = amc::CreateCurFunc();
Ins(&R, findrem.ret , "$Cpptype*", false);
Ins(&R, findrem.proto, "$name_FindRemove($Parent, $Hashfldarg key)", false);
- Ins(&R, findrem.body, "u32 index = $Hashfldtype_Hash(0, key) & ($parname.$name_buckets_n - 1);");
- Ins(&R, findrem.body, "$Cpptype* *prev = &$parname.$name_buckets_elems[index];");
+ if (HashLinearQ()) {
+ Ins(&R, findrem.body, " u32 index = key;");
+ Ins(&R, findrem.body, " $Cpptype* *prev = index < u32($parname.$name_buckets_n) ? &$parname.$name_buckets_elems[index] : NULL; // addr of pointer to current element");
+ } else {
+ Ins(&R, findrem.body, " u32 index = $Hashfldtype_Hash(0, key) & ($parname.$name_buckets_n - 1);");
+ Ins(&R, findrem.body, " $Cpptype* *prev = &$parname.$name_buckets_elems[index];");
+ }
Ins(&R, findrem.body, "$Cpptype* ret=NULL;");
+ if (HashLinearQ()) {
+ Ins(&R, findrem.body, "if (prev) {");
+ }
Ins(&R, findrem.body, "do {");
Ins(&R, findrem.body, " ret = *prev;");
Ins(&R, findrem.body, " bool done = !ret || $rethashfld == key;");
Ins(&R, findrem.body, " if (done) break;");
- Ins(&R, findrem.body, " prev = &ret->$name_next;");
+ Ins(&R, findrem.body, " prev = &ret->$xfname_next;");
Ins(&R, findrem.body, "} while (true);");
+ if (HashLinearQ()) {
+ Ins(&R, findrem.body, "}");
+ }
Ins(&R, findrem.body, "if (ret) {");
- Ins(&R, findrem.body, " *prev = ret->$name_next;");
- Ins(&R, findrem.body, " ret->$name_next = ($Cpptype*)-1; // not-in-hash");
+ Ins(&R, findrem.body, " *prev = ret->$xfname_next;");
+ Ins(&R, findrem.body, " ret->$xfname_next = ($Cpptype*)-1; // not-in-hash");
Ins(&R, findrem.body, " $parname.$name_n--;");
Ins(&R, findrem.body, "}");
Ins(&R, findrem.body, "return ret;");
@@ -462,7 +527,7 @@ void amc::tfunc_Thash_curs() {
Ins(&R, curs_next.comment, "proceed to next item");
Ins(&R, curs_next.ret , "void", false);
Ins(&R, curs_next.proto, "$Parname_$name_curs_Next($Parname_$name_curs &curs)", false);
- Ins(&R, curs_next.body, "curs.prow = &(*curs.prow)->$name_next;");
+ Ins(&R, curs_next.body, "curs.prow = &(*curs.prow)->$xfname_next;");
Ins(&R, curs_next.body, "while (!*curs.prow) {");
Ins(&R, curs_next.body, " curs.bucket += 1;");
Ins(&R, curs_next.body, " if (curs.bucket >= curs.parent->$name_buckets_n) break;");
diff --git a/cpp/amc/tpool.cpp b/cpp/amc/tpool.cpp
index af542bbc..97e17ea4 100644
--- a/cpp/amc/tpool.cpp
+++ b/cpp/amc/tpool.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
diff --git a/cpp/amc/trace.cpp b/cpp/amc/trace.cpp
index d1a39340..223ad95e 100644
--- a/cpp/amc/trace.cpp
+++ b/cpp/amc/trace.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -85,6 +85,11 @@ void amc::gen_trace() {
}
}ind_end;
Main_Trace_Field(Subst(R,"$ns.trace.dispatch_$Dname_Unkmsg"), algo::Comment());
+ // this trace field will never be incremented but it's created anyway for symmetry --
+ // all trace fields that track steps are pairs of 2 u64's, N and total cycles.
+ if (dispatch.c_disptrace && dispatch.c_disptrace->cycle) {
+ Main_Trace_Field(Subst(R,"$ns.trace.dispatch_$Dname_Unkmsg_cycles"), algo::Comment());
+ }
}ind_end;
// alloc
@@ -96,21 +101,24 @@ void amc::gen_trace() {
&& parent.p_ns->c_globfld
&& field.c_ftrace;
// Add tracefld for fbuf out egain
- bool fbuf_trace = field.c_fbuf
- && fbufdir_Get(*field.c_fbuf) == dmmeta_Fbufdir_fbufdir_out
- && field.c_ftrace;
+ bool fbuf_trace = field.c_fbuf && field.c_ftrace;
+ bool fbuf_trace_in = fbuf_trace && fbufdir_Get(*field.c_fbuf) == dmmeta_Fbufdir_fbufdir_in;
+ bool fbuf_trace_out = fbuf_trace && fbufdir_Get(*field.c_fbuf) == dmmeta_Fbufdir_fbufdir_out;
+ Set(R,"$ns" , ns_Get(parent));
+ Set(R,"$partrace", Refname(*field.p_ctype));
+ Set(R,"$name" , name_Get(field));
if (regular_trace) {
- Set(R,"$ns" , ns_Get(parent));
- Set(R,"$partrace", Refname(*field.p_ctype));
- Set(R,"$name" , name_Get(field));
Main_Trace_Field(Subst(R,"$ns.trace.alloc_$partrace_$name"), field.p_arg->comment);
Main_Trace_Field(Subst(R,"$ns.trace.del_$partrace_$name"), field.p_arg->comment);
}
- if (fbuf_trace) {
- Set(R,"$ns" , ns_Get(parent));
- Set(R,"$partrace", Refname(*field.p_ctype));
- Set(R,"$name" , name_Get(field));
+ if (fbuf_trace_out) {
Main_Trace_Field(Subst(R,"$ns.trace.$partrace_$name_n_eagain"), field.p_arg->comment);
+ Main_Trace_Field(Subst(R,"$ns.trace.$partrace_$name_n_write_byte"), field.p_arg->comment);
+ Main_Trace_Field(Subst(R,"$ns.trace.$partrace_$name_n_write_msg"), field.p_arg->comment);
+ }
+ if (fbuf_trace_in) {
+ Main_Trace_Field(Subst(R,"$ns.trace.$partrace_$name_n_read_byte"), field.p_arg->comment);
+ Main_Trace_Field(Subst(R,"$ns.trace.$partrace_$name_n_read_msg"), field.p_arg->comment);
}
// mark field as being traced
field.do_trace = regular_trace || fbuf_trace;
diff --git a/cpp/amc/upptr.cpp b/cpp/amc/upptr.cpp
index 0d84b2e1..d8cfb1eb 100644
--- a/cpp/amc/upptr.cpp
+++ b/cpp/amc/upptr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
diff --git a/cpp/amc/val.cpp b/cpp/amc/val.cpp
index 617e9669..5a2246be 100644
--- a/cpp/amc/val.cpp
+++ b/cpp/amc/val.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
@@ -44,7 +44,7 @@ void amc::tclass_Val() {
// endian suffix.
Set(R, "$suffix", "");
- Set(R, "$comment", field.comment);
+ Set(R, "$comment", field.comment, false);
if (field.c_fbigend) {
Set(R, "$suffix", "_be");
diff --git a/cpp/amc/varlen.cpp b/cpp/amc/varlen.cpp
index ed1ef13c..17acdb96 100644
--- a/cpp/amc/varlen.cpp
+++ b/cpp/amc/varlen.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2026 AlgoRND
// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange
// Copyright (C) 2008-2012 AlgoEngineering LLC
//
@@ -24,9 +24,56 @@
#include "include/amc.h"
+amc::FField *amc::LengthField(amc::FCtype &ctype) {
+ return ctype.c_lenfld ? ctype.c_lenfld->p_field : NULL;
+}
+
+tempstr amc::LengthType(amc::FCtype &ctype) {
+ tempstr ret;
+ if (amc::FField *lenfld = LengthField(ctype)) {
+ ret << lenfld->cpp_type;
+ } else {
+ ret << "u32";
+ }
+ return ret;
+}
+
+tempstr amc::VarlenEndName(amc::FField &field) {
+ return tempstr() << name_Get(field) << "_end";
+}
+
+tempstr amc::VarlenEndExpr(strptr parname, amc::FField &field) {
+ tempstr ret;
+ if (amc::FField *lenfld = LengthField(*field.p_ctype)) {
+ ret = FieldvalExpr(NULL,*lenfld,parname,VarlenEndName(field));
+ } else {
+ ret << VarlenEndName(field);
+ }
+ return ret;
+}
+
+tempstr amc::VarlenEndAssign(strptr parname, amc::FField &field, strptr value) {
+ tempstr ret;
+ if (amc::FField *lenfld = LengthField(*field.p_ctype)) {
+ ret = AssignExpr(*lenfld, parname, value, true, VarlenEndName(field));
+ } else {
+ ret << VarlenEndName(field) << " = " << value;
+ }
+ return ret;
+}
+
+tempstr amc::VarlenEndIncr(strptr parname, amc::FField &field, strptr incr) {
+ tempstr value = tempstr() << VarlenEndExpr(parname,field) << " + " << incr;
+ return amc::VarlenEndAssign(parname, field, value);
+}
+
void amc::tclass_Varlen() {
algo_lib::Replscope &R = amc::_db.genctx.R;
amc::FField &field = *amc::_db.genctx.p_field;
+ if (ctype_zd_varlenfld_Next(field)) {
+ Set(R, "$lentype", LengthType(*field.p_ctype));
+ InsVar(R, field.p_ctype, "$lentype", VarlenEndName(field), "", "end of $name field");
+ }
InsStruct(R, field.p_ctype, "// var-length field $field starts here. access it with $name_Addr");
Set(R, "$lenexpr", LengthExpr(*field.p_ctype, Subst(R,"$parname")));
Set(R, "$curslenexpr", LengthExpr(*field.p_ctype, Subst(R,"parent")));
@@ -46,23 +93,28 @@ void amc::tclass_Varlen() {
// Ensure that this field is last
bool seen = false;
ind_beg(amc::ctype_c_field_curs, _field,*field.p_ctype) {
- if (seen) {
+ if (_field.reftype == dmmeta_Reftype_reftype_Varlen) {
+ seen = true;
+ } else if (seen) {
prerr("amc.varlen_last"
<c_lenfld) {
- Set(R, "$lenexpr", LengthExpr(*field.p_ctype, "(($Partype&)$parname)"));
- Ins(&R, get_n.body, "u32 length = $lenexpr;");
- Ins(&R, get_n.body, "u32 extra_bytes = u32_Max(length,sizeof($Partype)) - sizeof($Partype); // avoid unsigned subtraction underflow");
- Ins(&R, get_n.body, "return u32(extra_bytes / sizeof($rettype));");
+ if (ctype_zd_varlenfld_Prev(field)) {
+ Set(R, "$prevend", VarlenEndExpr(Subst(R,"$parname"),*ctype_zd_varlenfld_Prev(field)));
+ Set(R, "$minusprevend", " - $prevend");
+ } else {
+ Set(R, "$minusprevend", "");
+ }
+ if (ctype_zd_varlenfld_Next(field)) {
+ Set(R, "$endexpr", VarlenEndExpr(Subst(R,"$parname"),field));
+ Ins(&R, get_n.body, "return u32(($endexpr$minusprevend) / sizeof($rettype));");
} else {
- get_n.extrn=true;
+ if (field.p_ctype->c_lenfld) {
+ Set(R, "$lenexpr", LengthExpr(*field.p_ctype, "(($Partype&)$parname)"));
+ Ins(&R, get_n.body, "u32 length = $lenexpr;");
+ Ins(&R, get_n.body, "u32 extra_bytes = u32_Max(length,sizeof($Partype)) - sizeof($Partype)$minusprevend; // avoid unsigned subtraction underflow");
+ Ins(&R, get_n.body, "return u32(extra_bytes / sizeof($rettype));");
+ } else {
+ get_n.acrkey << "field:"<c_typefld) {
Set(R, "$Fldhdrtype", field.p_arg->c_typefld->p_ctype->cpp_type);
Ins(&R, rd.body, " algo::ByteAry temp;");
Ins(&R, rd.body, " retval = $FldhdrtypeMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here");
- Ins(&R, rd.body, " ary_Addary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it");
+ if (ctype_zd_varlenfld_Next(field)) {
+ Ins(&R, rd.body , " ary_Insary(*algo_lib::_db.varlenbuf,ary_Getary(temp),$endexpr);");
+ Ins(&R, rd.body , " u32 incr = ary_N(temp);");
+ } else {
+ Ins(&R, rd.body, " ary_Addary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it");
+ }
} else {
Set(R, "$Fldcpptype", field.cpp_type);
- Ins(&R, rd.body , " $Fldcpptype *$name_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof($Fldcpptype)).elems) $Fldcpptype;");
+ if (ctype_zd_varlenfld_Next(field)) {
+ Ins(&R, rd.body , " $Fldcpptype *$name_tmp = new(ary_AllocNAt(*algo_lib::_db.varlenbuf, sizeof($Fldcpptype), $endexpr).elems) $Fldcpptype;");
+ Ins(&R, rd.body , " u32 incr = sizeof($Fldcpptype);");
+ } else {
+ Ins(&R, rd.body , " $Fldcpptype *$name_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof($Fldcpptype)).elems) $Fldcpptype;");
+ }
+ if (VarlenQ(*field.p_arg)) {
+ Ins(&R, rd.body , " algo::ByteAry varlenbuf;");
+ Ins(&R, rd.body , " algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf;");
+ Ins(&R, rd.body , " algo_lib::_db.varlenbuf = &varlenbuf;");
+ }
Ins(&R, rd.body , " retval = $Cpptype_ReadStrptrMaybe(*$name_tmp, in_str);");
+ if (VarlenQ(*field.p_arg)) {
+ Ins(&R, rd.body , " algo_lib::_db.varlenbuf = varlenbuf_save;");
+ if (field.p_ctype->c_lenfld) {
+ cstring len("sizeof($Fldcpptype)+ary_N(varlenbuf)");
+ if (field.p_ctype->c_lenfld->extra > 0) {
+ len << "+" << field.p_ctype->c_lenfld->extra;
+ } else if (field.p_ctype->c_lenfld->extra < 0) {
+ len << field.p_ctype->c_lenfld->extra;
+ }
+ Set(R,"$lenincr",amc::AssignExpr(*field.p_ctype->c_lenfld->p_field,Subst(R,"(*$name_tmp)"),Subst(R,len),true));
+ Ins(&R, rd.body , " $lenincr;");
+ }
+ if (ctype_zd_varlenfld_Next(field)) {
+ Ins(&R, rd.body , " ary_Insary(*algo_lib::_db.varlenbuf,varlenbuf,$endexpr+sizeof($Fldcpptype));");
+ Ins(&R, rd.body , " incr += ary_N(varlenbuf);");
+ } else {
+ Ins(&R, rd.body , " ary_Addary(*algo_lib::_db.varlenbuf,varlenbuf);");
+ }
+ }
+ }
+ if (ctype_zd_varlenfld_Next(field)) {
+ for (FField *ptr = &field; ctype_zd_varlenfld_Next(*ptr); ptr = ctype_zd_varlenfld_Next(*ptr)) {
+ Set(R, "$endincr", VarlenEndIncr(Subst(R,"$parname"),*ptr,"incr"));
+ Ins(&R, rd.body , " $endincr;");
+ }
}
Ins(&R, rd.body, "}");
SetPresent(rd,Subst(R,"$parname"),field);
@@ -140,8 +252,19 @@ void amc::tfunc_Varlen_curs() {
amc::FFunc& curs_reset = amc::CreateInlineFunc(Subst(R,"$field_curs.Reset"));
Ins(&R, curs_reset.ret , "void", false);
Ins(&R, curs_reset.proto, "$Parname_$name_curs_Reset($Parname_$name_curs &curs, $Partype &parent)", false);
- Ins(&R, curs_reset.body, "curs.ptr = (u8*)&parent + sizeof($Partype);");
- Ins(&R, curs_reset.body, "curs.length = $curslenexpr - sizeof($Partype);");
+ Ins(&R, curs_reset.body, "curs.ptr = (u8*)$name_Addr(parent);");
+ if (ctype_zd_varlenfld_Prev(field)) {
+ Set(R, "$prevend", VarlenEndExpr(Subst(R,"$parname"),*ctype_zd_varlenfld_Prev(field)));
+ Set(R, "$minusprevend", "- $prevend");
+ } else {
+ Set(R, "$minusprevend", "");
+ }
+ if (ctype_zd_varlenfld_Next(field)) {
+ Set(R, "$endexpr", VarlenEndExpr(Subst(R,"$parname"),field));
+ Ins(&R, curs_reset.body, "curs.length = $endexpr$minusprevend;");
+ } else {
+ Ins(&R, curs_reset.body, "curs.length = $curslenexpr $minusprevend - sizeof($Partype);");
+ }
Ins(&R, curs_reset.body, "curs.index = 0;");
}
@@ -185,3 +308,14 @@ void amc::tfunc_Varlen_curs() {
void amc::tfunc_Varlen_Print() {
tfunc_Inlary_Print();
}
+
+void amc::tfunc_Varlen_Init() {
+ algo_lib::Replscope &R = amc::_db.genctx.R;
+ amc::FField &field = *amc::_db.genctx.p_field;
+ amc::FFunc& init = amc::CreateCurFunc();
+ init.inl = true;
+ if (ctype_zd_varlenfld_Next(field)) {
+ Set(R, "$endassign", VarlenEndAssign(Subst(R,"$parname"),field,"0"));
+ Ins(&R, init.body, "$endassign; // $name: initialize");
+ }
+}
diff --git a/cpp/ams/ams_cat.cpp b/cpp/ams/ams_cat.cpp
deleted file mode 100644
index 1627a07a..00000000
--- a/cpp/ams/ams_cat.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2023-2024 AlgoRND
-//
-// License: GPL
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-//
-// Target: ams_cat (exe) -- Algo Messaging System sample tool
-// Exceptions: yes
-// Source: cpp/ams/ams_cat.cpp
-//
-// Read messages from STDIN and echo any produced messages to
-// STDOUT.
-// No shared memory. This is a test tool.
-
-#include "include/algo.h"
-#include "include/ams_cat.h"
-#include "include/lib_ams.h"
-
-// -----------------------------------------------------------------------------
-
-void ams_cat::Main() {
- ams::ProcId my_id(ams_ProcType_amstest,0); // amstest-0
- lib_ams::SetDfltShmSize(1024*32);
- lib_ams::Init("", my_id);
- Regx_ReadSql(lib_ams::_db.regx_trace,"%",true);
-
- // amstest-0.ctl-0
- lib_ams::FStream &ctl0=lib_ams::ind_stream_GetOrCreate(ams::StreamId(my_id, ams_StreamType_ctl,0));
- vrfy_(lib_ams::AddCtlIn(ctl0));
-
- // amstest-0.log-0
- lib_ams::FStream &out=lib_ams::ind_stream_GetOrCreate(ams::StreamId(my_id, ams_StreamType_out,0));
- vrfy_(lib_ams::OpenStream(out,ams::StreamFlags(ams_StreamFlags_write|ams_StreamFlags_nonblock),ams::StreamPos()));
- ams_cat::MainLoop();// process events
-}
diff --git a/cpp/ams_sendtest.cpp b/cpp/ams_sendtest.cpp
index 0bd7078c..01c2d693 100644
--- a/cpp/ams_sendtest.cpp
+++ b/cpp/ams_sendtest.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -18,7 +18,7 @@
// Exceptions: yes
// Source: cpp/ams_sendtest.cpp
//
-// Streams:
+// Shms:
// - amstest-0.out-0
// - amstest-{0..N}.ctl-0
// Processes:
@@ -28,7 +28,7 @@
// - Write amstest-0.out-0, write amstest-0.ctl-0, read amstest-{1..N}.ctl-0
// Each child #K:
// - Write amstest-K.ctl-0, read amstest-0.ctl-0, read amstest-0.out-0
-// Parent: write N messages to output stream
+// Parent: write N messages to output shm
// - Each child: read messages and note latency; once a fixed number
// - of messages are read, report average latency and exit
@@ -36,8 +36,14 @@
#include "include/ams_sendtest.h"
#include "include/lib_ams.h"
+lib_ams::FShm &ams_sendtest::GetOrCreateShm(ams::ShmId shm_id) {
+ lib_ams::ind_proc_GetOrCreate(shm_id.proc_id);
+ return lib_ams::ind_shm_GetOrCreate(shm_id);
+}
+
// child reads parent messsage
-static void ReadParentMsg(lib_ams::FStream &stream, ams::MsgHeader &) {
+static void ReadParentMsg(lib_ams::FShm &shm, ams::MsgHeader &msg) {
+ (void)shm;
ams_sendtest::AmsSendTest &frame = ams_sendtest::_db.ams_send_test;
if (ams_sendtest::_db.cmdline.recvdelay_ns>0) {
u64 clock=algo::get_cycles();
@@ -48,13 +54,16 @@ static void ReadParentMsg(lib_ams::FStream &stream, ams::MsgHeader &) {
}
}
frame.n_msg_recv++;
+ frame.off_recv = lib_ams::AddOffset(frame.off_recv, lib_ams::_db.c_cur_shmember->c_cur_msg->length);
// zero out first message latency
- u64 tsc = algo::get_cycles();
- u64 msgtsc = stream.cur_msg->tsc;
- frame.sum_recv_latency += tsc - msgtsc;
- if (frame.n_msg_recv >= frame.n_msg_limit) {
- prlog("child: received all messages");
- algo_lib::ReqExitMainLoop();
+ if (ams::LogMsg *logmsg = ams::LogMsg_Castdown(msg)) {
+ u64 tsc = algo::get_cycles();
+ u64 msgtsc = logmsg->tstamp.value;
+ frame.sum_recv_latency += tsc - msgtsc;
+ if (frame.n_msg_recv >= frame.n_msg_limit) {
+ prlog("child: received all messages, offset "<length<<" offset "<shm_region.elems));
vrfy_(ams::text_Getary(*msg) == text);
frame.n_msg_send++;
+ frame.off_send = lib_ams::AddOffset(frame.off_send, seqmsg->length);
if (frame.n_msg_send == frame.n_msg_limit) {
bh_timehook_Remove(frame.h_write);
- // artificial: stop reading streams to exit main loop
+ // artificial: stop reading shms to exit main loop
lib_ams::cd_poll_read_RemoveAll();
- lib_ams::cd_stream_hb_RemoveAll();
- prlog("parent: wrote all "<0) {
+ prlog("waiting for child to open output shm (attempt "<off == frame.off_send;
+ lib_ams::Close(log0);
} else {
double avg_clocks = frame.sum_recv_latency / u64_Max(frame.n_msg_recv,1);
double avg_ns = avg_clocks * algo_lib::_db.clocks_to_ns;
- prlog("Child: avg recv latency "<< avg_ns<<" ns");
- ok = out0.rpos.seq == frame.n_msg_limit+1;
+ prlog("Child: avg recv latency "<< avg_ns<<" ns, read off "<off<<" off_recv "<off == frame.off_recv;
}
if (!ok) {
- lib_ams::DumpStreamTable();
+ algo_lib::Regx regx;
+ Regx_ReadSql(regx,"%",true);
+ lib_ams::DumpShmTableVisual(regx);
algo_lib::_db.exit_code=1;
}
prlog(lib_ams::_db.proc_id
<< " ams_sendtest.end"
- <off : 0))
+ <off : 0))
<srcfield==pkey->field && algo::LeftPathcompQ(field.c_substr->expr.value));
+ }
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+
// Load all records (FRec) from dataset _db.cmdline.data_in)
// For each record (FRec), compute p_ssimfile, pkey, tuple
// Populate global zd_rec index
@@ -136,7 +151,7 @@ void apm::LoadRecs() {
// build graph of all records
// compute c_child, c_leftchild
ind_beg(_db_zd_rec_curs,rec,_db) {
- ind_beg(ctype_c_field_curs,field,*rec.p_ssimfile->p_ctype) if (field.reftype==dmmeta_Reftype_reftype_Pkey) {
+ ind_beg(ctype_c_field_curs,field,*rec.p_ssimfile->p_ctype) if (LeftCheckQ(field)) {
algo::Attr *attr=attr_Find(rec.tuple,name_Get(field.c_substr ? *field.c_substr->p_srcfield:field));
if (attr && field.p_arg->c_ssimfile) {
algo::strptr value = field.c_substr ? Pathcomp(attr->value,field.c_substr->expr.value) : attr->value;
@@ -158,7 +173,7 @@ void apm::LoadRecs() {
tempstr child_key = Subst(R,ssimreq.ssimreq);
apm::FRec *child = apm::ind_rec_Find(child_key);
if (child && child != &rec) {
- verblog2(child->rec<<" now child of "<rec<<" now child of "<
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/atree.cpp
//
diff --git a/cpp/atf_amc/bheap.cpp b/cpp/atf_amc/bheap.cpp
index cd46d6ae..d7fbe72a 100644
--- a/cpp/atf_amc/bheap.cpp
+++ b/cpp/atf_amc/bheap.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/bheap.cpp
//
diff --git a/cpp/atf_amc/bigend.cpp b/cpp/atf_amc/bigend.cpp
index f50636a7..339b34d3 100644
--- a/cpp/atf_amc/bigend.cpp
+++ b/cpp/atf_amc/bigend.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/bigend.cpp
//
diff --git a/cpp/atf_amc/bitfld.cpp b/cpp/atf_amc/bitfld.cpp
index 13a2743c..9f6d7c63 100644
--- a/cpp/atf_amc/bitfld.cpp
+++ b/cpp/atf_amc/bitfld.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/bitfld.cpp
//
diff --git a/cpp/atf_amc/bitset.cpp b/cpp/atf_amc/bitset.cpp
index d0e74ff4..e6813b5a 100644
--- a/cpp/atf_amc/bitset.cpp
+++ b/cpp/atf_amc/bitset.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
// along with this program. If not, see .
//
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/bitset.cpp
//
diff --git a/cpp/atf_amc/cascdel.cpp b/cpp/atf_amc/cascdel.cpp
index d92aeff1..9fe5d64c 100644
--- a/cpp/atf_amc/cascdel.cpp
+++ b/cpp/atf_amc/cascdel.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/cascdel.cpp
//
diff --git a/cpp/atf_amc/cdlist.cpp b/cpp/atf_amc/cdlist.cpp
index 3b683d98..5e850400 100644
--- a/cpp/atf_amc/cdlist.cpp
+++ b/cpp/atf_amc/cdlist.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/cdlist.cpp
//
diff --git a/cpp/atf_amc/cleanup.cpp b/cpp/atf_amc/cleanup.cpp
index 9efd39b6..1dbf46a7 100644
--- a/cpp/atf_amc/cleanup.cpp
+++ b/cpp/atf_amc/cleanup.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/cleanup.cpp
//
diff --git a/cpp/atf_amc/cmp.cpp b/cpp/atf_amc/cmp.cpp
index e8c82e2c..9527ecf9 100644
--- a/cpp/atf_amc/cmp.cpp
+++ b/cpp/atf_amc/cmp.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/cmp.cpp
//
diff --git a/cpp/atf_amc/cslist.cpp b/cpp/atf_amc/cslist.cpp
index 8f9b6d5d..e619cc17 100644
--- a/cpp/atf_amc/cslist.cpp
+++ b/cpp/atf_amc/cslist.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/cslist.cpp
//
diff --git a/cpp/atf_amc/delptr.cpp b/cpp/atf_amc/delptr.cpp
index d0dd8206..54fd260f 100644
--- a/cpp/atf_amc/delptr.cpp
+++ b/cpp/atf_amc/delptr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/delptr.cpp
//
diff --git a/cpp/atf_amc/dispatch.cpp b/cpp/atf_amc/dispatch.cpp
index 4260ff13..aff8e87d 100644
--- a/cpp/atf_amc/dispatch.cpp
+++ b/cpp/atf_amc/dispatch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/dispatch.cpp
//
diff --git a/cpp/atf_amc/exec.cpp b/cpp/atf_amc/exec.cpp
index a9d9da82..bda9313a 100644
--- a/cpp/atf_amc/exec.cpp
+++ b/cpp/atf_amc/exec.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2023 Astra
// Copyright (C) 2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/exec.cpp
//
diff --git a/cpp/atf_amc/fbuf.cpp b/cpp/atf_amc/fbuf.cpp
index a71ebfc0..bec3daa7 100644
--- a/cpp/atf_amc/fbuf.cpp
+++ b/cpp/atf_amc/fbuf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/fbuf.cpp
//
@@ -116,6 +116,7 @@ void atf_amc::amctest_msgbuf_test4() {
in_buf_WriteAll(msgbuf, (u8*)hdr2, 60); // write second message partially
//
msg = in_buf_GetMsg(msgbuf); // get first message
+ vrfy_(msg);
vrfyeq_(msg->type, hdr->type); //it should be OK
vrfyeq_(msg->length, hdr->length); //it should be OK
vrfyeq_(memcmp(msg, hdr, hdr->length), 0);
@@ -124,8 +125,9 @@ void atf_amc::amctest_msgbuf_test4() {
msg = in_buf_GetMsg(msgbuf);// try to access next message
vrfyeq_((u64)msg, (u64)0);// message should not be there
- in_buf_WriteAll(msgbuf, ((u8*)hdr2)+60, 4);// write remainder of second message
+ vrfy_(in_buf_WriteAll(msgbuf, ((u8*)hdr2)+60, 4));// write remainder of second message
msg = in_buf_GetMsg(msgbuf);// try to access second message
+ vrfy_(msg);
vrfyeq_(msg->type, hdr2->type);// message is there
vrfyeq_(msg->length, hdr2->length);// message is there
vrfyeq_(memcmp(msg, hdr2, hdr2->length), 0);
diff --git a/cpp/atf_amc/fconst.cpp b/cpp/atf_amc/fconst.cpp
index a2f6ac40..f9e02daa 100644
--- a/cpp/atf_amc/fconst.cpp
+++ b/cpp/atf_amc/fconst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/fconst.cpp
//
diff --git a/cpp/atf_amc/fstep.cpp b/cpp/atf_amc/fstep.cpp
index 4774b66f..37f935ad 100644
--- a/cpp/atf_amc/fstep.cpp
+++ b/cpp/atf_amc/fstep.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/fstep.cpp
//
@@ -41,26 +41,83 @@ void atf_amc::amctest_fstep_InlineRecur() {
// -----------------------------------------------------------------------------
-static int _num;
static void IncrNum() {
- _num++;
+ atf_amc::_db.timehook_recur_counter++;
}
void atf_amc::amctest_fstep_TimeHookRecur() {
+ // check the TimeHookRecur is scheduling things repeatedly
bool success=false;
for (int retry=0; retry<60 && !success; retry++) {
if (retry>0) {
- _num=0;
+ atf_amc::_db.timehook_recur_counter=0;
sleep(1);
}
algo_lib::FTimehook th;
- ThInitRecur(th,algo::ToSchedTime(0.01));
hook_Set0(th, IncrNum);
- bh_timehook_Insert(th);
+ ThScheduleRecur(th,algo::ToSchedTime(0.01));
algo_lib::_db.limit = algo::CurrSchedTime() + algo::ToSchedTime(0.1);
MainLoop();
- prlog(_num<<" <=> "<<7);
- success = _num>=7 && _num<=10;
+ prlog(atf_amc::_db.timehook_recur_counter<<" <=> "<<7);
+ success = atf_amc::_db.timehook_recur_counter>=7 && atf_amc::_db.timehook_recur_counter<=10;
}
vrfy_(success);
}
+
+// -----------------------------------------------------------------------------
+
+void atf_amc::bh_time_entry_Step() {
+ time_entry_Delete(*bh_time_entry_RemoveFirst());
+ atf_amc::_db.timehook_once_counter++;
+}
+
+void atf_amc::amctest_fstep_TimeHookOnce() {
+ atf_amc::FTimeEntry &a=time_entry_Alloc();
+ time_entry_XrefMaybe(a);
+ // initially it's not in the heap
+ vrfy_(!bh_time_entry_InBheapQ(a));
+ vrfy_(!bh_timehook_InBheapQ(_db.th_bh_time_entry));
+ // now schedule it
+ a.time = algo::SchedTime(3);
+ bh_time_entry_Reheap(a);
+ // now the time hook has been scheduled
+ vrfy_(bh_timehook_InBheapQ(_db.th_bh_time_entry));
+
+ // add an entry that preempts it
+ atf_amc::FTimeEntry &b=time_entry_Alloc();
+ time_entry_XrefMaybe(b);
+ b.time = algo::SchedTime(2);
+ bh_time_entry_Reheap(b);
+ vrfy_(bh_timehook_InBheapQ(_db.th_bh_time_entry));
+ // b must be scheduled
+ vrfy_(_db.th_bh_time_entry.time == b.time);
+
+ // add an entry that doesn't preempts anyone
+ atf_amc::FTimeEntry &c=time_entry_Alloc();
+ time_entry_XrefMaybe(c);
+ c.time = algo::SchedTime(10);
+ bh_time_entry_Reheap(c);
+ vrfy_(bh_timehook_InBheapQ(_db.th_bh_time_entry));
+ // b is still scheduled
+ vrfy_(_db.th_bh_time_entry.time == b.time);
+
+ // delete b
+ time_entry_Delete(b);
+ // a becomes first
+ vrfy_(_db.th_bh_time_entry.time == a.time);
+ time_entry_Delete(a);
+ // c becomes first
+ vrfy_(_db.th_bh_time_entry.time == c.time);
+ time_entry_Delete(c);
+ // timehook heap must be empty now
+ vrfy_(algo_lib::bh_timehook_N()==0);
+
+ for (int i=0; i<10; i++) {
+ atf_amc::FTimeEntry &e =time_entry_Alloc();
+ e.time = algo_lib::_db.clock + algo::ToSchedTime(i*0.01);
+ time_entry_XrefMaybe(e);
+ bh_time_entry_Reheap(e);
+ }
+ atf_amc::MainLoop();
+ vrfy_(atf_amc::_db.timehook_once_counter == 10);
+}
diff --git a/cpp/atf_amc/gsymbol.cpp b/cpp/atf_amc/gsymbol.cpp
index ecd94261..449e1be4 100644
--- a/cpp/atf_amc/gsymbol.cpp
+++ b/cpp/atf_amc/gsymbol.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2023 Astra
//
// License: GPL
@@ -16,7 +16,7 @@
// along with this program. If not, see .
//
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/gsymbol.cpp
//
diff --git a/cpp/atf_amc/hook.cpp b/cpp/atf_amc/hook.cpp
index dd8d83c2..6427fded 100644
--- a/cpp/atf_amc/hook.cpp
+++ b/cpp/atf_amc/hook.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/hook.cpp
//
@@ -80,14 +80,37 @@ void atf_amc::amctest_Hook1() {
// Static hooks with argument
// amctest itself uses static hook without argument, so we'll assume it's been
// tested.
-void atf_amc::listtype_cd(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_cdl(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_cs(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_csl(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_zd(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_zdl(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_zs(atf_amc::FListtype &listtype) { listtype.seen = true; }
-void atf_amc::listtype_zsl(atf_amc::FListtype &listtype) { listtype.seen = true; }
+void atf_amc::listtype_cd(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_cdl(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_cs(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_csl(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_zd(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_zdl(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_zs(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
+
+void atf_amc::listtype_zsl(atf_amc::FListtype &listtype) {
+ listtype.seen = true;
+}
void atf_amc::amctest_Hook2() {
// call all static hooks
diff --git a/cpp/atf_amc/inlary.cpp b/cpp/atf_amc/inlary.cpp
index a348b434..24616b31 100644
--- a/cpp/atf_amc/inlary.cpp
+++ b/cpp/atf_amc/inlary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/inlary.cpp
//
diff --git a/cpp/atf_amc/lary.cpp b/cpp/atf_amc/lary.cpp
index 2f61fbc7..3dbed25e 100644
--- a/cpp/atf_amc/lary.cpp
+++ b/cpp/atf_amc/lary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
//
// License: GPL
// This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
// along with this program. If not, see .
//
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/lary.cpp
//
diff --git a/cpp/atf_amc/lineiter.cpp b/cpp/atf_amc/lineiter.cpp
index cf17c44b..d877651d 100644
--- a/cpp/atf_amc/lineiter.cpp
+++ b/cpp/atf_amc/lineiter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/lineiter.cpp
//
diff --git a/cpp/atf_amc/lpool.cpp b/cpp/atf_amc/lpool.cpp
index 1549efbe..9c62640c 100644
--- a/cpp/atf_amc/lpool.cpp
+++ b/cpp/atf_amc/lpool.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/lpool.cpp
//
diff --git a/cpp/atf_amc/main.cpp b/cpp/atf_amc/main.cpp
index 237a9865..ebfd1310 100644
--- a/cpp/atf_amc/main.cpp
+++ b/cpp/atf_amc/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2017-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/main.cpp
//
diff --git a/cpp/atf_amc/msgcurs.cpp b/cpp/atf_amc/msgcurs.cpp
index 9354cc13..d5cc40b7 100644
--- a/cpp/atf_amc/msgcurs.cpp
+++ b/cpp/atf_amc/msgcurs.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/msgcurs.cpp
//
diff --git a/cpp/atf_amc/numstr.cpp b/cpp/atf_amc/numstr.cpp
index 0d4efa5d..21c4e3ae 100644
--- a/cpp/atf_amc/numstr.cpp
+++ b/cpp/atf_amc/numstr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/numstr.cpp
//
diff --git a/cpp/atf_amc/opt.cpp b/cpp/atf_amc/opt.cpp
index 72d5edcb..297da5b2 100644
--- a/cpp/atf_amc/opt.cpp
+++ b/cpp/atf_amc/opt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/opt.cpp
//
diff --git a/cpp/atf_amc/pmask.cpp b/cpp/atf_amc/pmask.cpp
index f121020b..88fd7f20 100644
--- a/cpp/atf_amc/pmask.cpp
+++ b/cpp/atf_amc/pmask.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/pmask.cpp
//
diff --git a/cpp/atf_amc/ptrary.cpp b/cpp/atf_amc/ptrary.cpp
index 823d084a..d723ae1a 100644
--- a/cpp/atf_amc/ptrary.cpp
+++ b/cpp/atf_amc/ptrary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
// License: GPL
@@ -17,7 +17,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/ptrary.cpp
//
@@ -31,31 +31,31 @@ void atf_amc::amctest_PtraryInsert() {
// insert a.
c_typek_Insert(a);
vrfy_(c_typek_Find(0)==&a);
- vrfy_(a._db_c_typek_in_ary ==true);
+ vrfy_(a.c_typek_in_ary ==true);
vrfy_(c_typek_N()==1);
// insert again -- no effect
c_typek_Insert(a);
vrfy_(c_typek_Find(0)==&a);
- vrfy_(a._db_c_typek_in_ary ==true);
+ vrfy_(a.c_typek_in_ary ==true);
vrfy_(c_typek_N()==1);
// remove
c_typek_Remove(a);
vrfy_(c_typek_Find(0)==NULL);
- vrfy_(a._db_c_typek_in_ary ==false);
+ vrfy_(a.c_typek_in_ary ==false);
vrfy_(c_typek_N()==0);
// remove again -- no effect
c_typek_Remove(a);
vrfy_(c_typek_Find(0)==NULL);
- vrfy_(a._db_c_typek_in_ary ==false);
+ vrfy_(a.c_typek_in_ary ==false);
vrfy_(c_typek_N()==0);
// reinsert -- should be there now
c_typek_Insert(a);
vrfy_(c_typek_Find(0)==&a);
- vrfy_(a._db_c_typek_in_ary ==true);
+ vrfy_(a.c_typek_in_ary ==true);
vrfy_(c_typek_N()==1);
}
@@ -65,14 +65,94 @@ void atf_amc::amctest_PtraryCursor() {
c_typek_Insert(a);
c_typek_Insert(b);
- vrfy_(a._db_c_typek_in_ary ==true);
- vrfy_(b._db_c_typek_in_ary ==true);
+ vrfy_(_db.c_typek_n==2);
+ vrfy_(a.c_typek_in_ary ==true);
+ vrfy_(b.c_typek_in_ary ==true);
// check that once cursor on unique array removes elements from list
ind_beg(_db_c_typek_oncecurs,typek,_db) {
vrfy_(ind_curs(typek).index!=0 || &typek == &a);
vrfy_(ind_curs(typek).index!=1 || &typek == &b);
}ind_end;
vrfy_(c_typek_N()==0);
- vrfy_(a._db_c_typek_in_ary ==false);
- vrfy_(b._db_c_typek_in_ary ==false);
+ vrfy_(a.c_typek_in_ary ==false);
+ vrfy_(b.c_typek_in_ary ==false);
+}
+
+// -----------------------------------------------------------------------------
+
+void atf_amc::amctest_PtraryHeaplike() {
+ atf_amc::FTypeL a,b,c;
+ vrfy_(c_typel_First()==NULL);
+ vrfy_(c_typel_Last()==NULL);
+
+ vrfy_(a.c_typel_idx==-1);
+ vrfy_(b.c_typel_idx==-1);
+ vrfy_(c.c_typel_idx==-1);
+
+ c_typel_Insert(a);
+ vrfy_(c_typel_First()==&a);
+ vrfy_(_db.c_typel_n==1);
+ c_typel_Insert(b);
+ vrfy_(c_typel_Last()==&b);
+ vrfy_(_db.c_typel_n==2);
+ c_typel_Insert(c);
+ vrfy_(c_typel_Last()==&c);
+
+ vrfy_(_db.c_typel_n==3);
+ vrfy_(a.c_typel_idx==0);
+ vrfy_(b.c_typel_idx==1);
+ vrfy_(c.c_typel_idx==2);
+
+ c_typel_Remove(a);
+ vrfy_(_db.c_typel_n==2);
+ vrfy_(a.c_typel_idx==-1);
+ vrfy_(b.c_typel_idx==1);
+ vrfy_(c.c_typel_idx==0);
+
+ c_typel_RemoveAll();
+ vrfy_(_db.c_typel_n==0);
+ vrfy_(a.c_typel_idx==-1);
+ vrfy_(b.c_typel_idx==-1);
+ vrfy_(c.c_typel_idx==-1);
+
+ c_typel_Insert(a);
+ c_typel_Insert(b);
+ c_typel_Insert(c);
+ vrfy_(c_typel_Last()==&c && c.c_typel_idx==2 && c_typel_RemoveLast()==&c);
+ vrfy_(c_typel_Last()==&b && b.c_typel_idx==1 && c_typel_RemoveLast()==&b);
+ vrfy_(c_typel_Last()==&a && a.c_typel_idx==0 && c_typel_RemoveLast()==&a);
+ vrfy_(c_typel_Last()==NULL && c_typel_RemoveLast()==NULL);
+
+ c_typel_Insert(a);
+ c_typel_Insert(b);
+ c_typel_Insert(c);
+ vrfy_(c_typel_First()==&a && a.c_typel_idx==0 && c_typel_RemoveFirst()==&a);
+ vrfy_(c_typel_First()==&c && c.c_typel_idx==0 && c_typel_RemoveFirst()==&c);
+ vrfy_(c_typel_First()==&b && b.c_typel_idx==0 && c_typel_RemoveFirst()==&b);
+ vrfy_(c_typel_Last()==NULL && c_typel_RemoveFirst()==NULL);
+}
+
+// -----------------------------------------------------------------------------
+
+void atf_amc::amctest_PtraryNonUnique() {
+ atf_amc::FTypeM a,b,c;
+
+ c_typem_Insert(a);
+ c_typem_Insert(b);
+ c_typem_Insert(c);
+ c_typem_Insert(a);
+ c_typem_Insert(a);
+ c_typem_Insert(c);
+
+ vrfy_(_db.c_typem_n == 6);
+
+ // non-unique Ptary - removal must scan for all references
+ c_typem_Remove(a);
+ vrfy_(_db.c_typem_n == 3);
+
+ c_typem_Remove(c);
+ vrfy_(_db.c_typem_n == 1);
+
+ c_typem_Remove(b);
+ vrfy_(_db.c_typem_n == 0);
}
diff --git a/cpp/atf_amc/readstr.cpp b/cpp/atf_amc/readstr.cpp
index 917d539f..9ddf6510 100644
--- a/cpp/atf_amc/readstr.cpp
+++ b/cpp/atf_amc/readstr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/readstr.cpp
//
@@ -51,13 +51,13 @@ void atf_amc::amctest_ReadTuple2() {
vrfyeq_(out, "atf_amc.Ctype2Attr attr1:33 attr2:44");
// Check that ReadStrptr works
atf_amc::Ctype2Attr in_ctype;
- Ctype2Attr_ReadStrptrMaybe(in_ctype, out);
+ vrfy_(Ctype2Attr_ReadStrptrMaybe(in_ctype, out));
vrfyeq_(in_ctype, out_ctype);
// Check that ReadTuple works the same
algo::Tuple tuple;
algo::Refurbish(in_ctype);
- Tuple_ReadStrptr(tuple, out, true /*attrs only*/);
- Ctype2Attr_ReadTupleMaybe(in_ctype, tuple);
+ Tuple_ReadStrptr(tuple, out, false);
+ vrfy_(Ctype2Attr_ReadTupleMaybe(in_ctype, tuple));
vrfyeq_(in_ctype, out_ctype);
}
diff --git a/cpp/atf_amc/sort.cpp b/cpp/atf_amc/sort.cpp
index 4a5e3ab5..12a474de 100644
--- a/cpp/atf_amc/sort.cpp
+++ b/cpp/atf_amc/sort.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/sort.cpp
//
diff --git a/cpp/atf_amc/strconv.cpp b/cpp/atf_amc/strconv.cpp
index 93352a6c..723b0046 100644
--- a/cpp/atf_amc/strconv.cpp
+++ b/cpp/atf_amc/strconv.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/strconv.cpp
//
@@ -168,20 +168,4 @@ static void StringConversionTest(StringDesc& desc) {
void atf_amc::amctest_TestString() {
atf_amc::ForAllStrings(&StringConversionTest);
algo::ForAllStrings(&StringConversionTest);
-
- algo_assert(sizeof(algo::RspaceStr9) == 9);
- algo_assert(sizeof(algo::RspaceStr10) == 10);
- algo_assert(sizeof(algo::RspaceStr11) == 11);
-
- algo_assert(sizeof(byte)== 1);
- algo_assert(sizeof(i8) == 1);
- algo_assert(sizeof(i16) == 2);
- algo_assert(sizeof(i32) == 4);
- algo_assert(sizeof(i64) == 8);
- algo_assert(sizeof(u8) == 1);
- algo_assert(sizeof(u16) == 2);
- algo_assert(sizeof(u32) == 4);
- algo_assert(sizeof(u64) == 8);
- algo_assert(sizeof(f32) == 4);
- algo_assert(sizeof(f64) == 8);
}
diff --git a/cpp/atf_amc/tary.cpp b/cpp/atf_amc/tary.cpp
index 74ec80b7..9bfd761d 100644
--- a/cpp/atf_amc/tary.cpp
+++ b/cpp/atf_amc/tary.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/tary.cpp
//
@@ -74,3 +74,156 @@ void atf_amc::amctest_TaryReserve() {
vrfy_(ary_N(tary_u8) + 100 <= ary_Max(tary_u8));
vrfy_(ary_N(tary_u8) + 1000 > ary_Max(tary_u8));
}
+
+void atf_amc::amctest_TaryHash() {
+ Hashable &h=hashable_Alloc();
+ ary_Alloc(h.key)=1234;
+ ary_Alloc(h.key)=5678;
+ hashable_XrefMaybe(h);
+
+ algo::U64Ary key;
+ ary_Alloc(key)=1234;
+ ary_Alloc(key)=5678;
+ vrfy_(ind_hashable_Find(key) == &h);
+ hashable_Delete(h);
+}
+
+void atf_amc::Insary(algo::StringAry &ary, const char *rhs[], int at) {
+ algo::StringAry _rhs;
+ for (; *rhs; ++rhs) {
+ ary_Alloc(_rhs) = *rhs;
+ }
+ ary_Insary(ary,_rhs, at);
+}
+
+bool atf_amc::Cmpary(algo::StringAry &ary, const char **rhs) {
+ return Cmpary(ary_Getary(ary),rhs);
+}
+
+bool atf_amc::Cmpary(algo::aryptr ary, const char **rhs) {
+ bool ret(true);
+ int ind = 0;
+ for (; ret && rhs[ind] && ind.
//
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/thash.cpp
//
@@ -202,3 +202,103 @@ void atf_amc::amctest_PerfThashRemove() {
prlog("atf_amc.PerfThashRemove"
<< Keyval("sllist_cycles_per_elem",sllist_cycles_per_elem));
}
+
+static u32 Lcg100Next(int prev) {
+ return (prev*21+1)%100;
+}
+
+void atf_amc::amctest_ThashLinear() {
+ // fill hash
+ vrfyeq_(ind_linear_EmptyQ(),true);
+ vrfyeq_(ind_linear_N(),0);
+ int x(0);
+ frep_(i,100) {
+ x = Lcg100Next(x);
+ vrfy_(ind_linear_GetOrCreate(algo::U32LinearKey(x)).ind_linear_next!=(FHashableLinear*)-1);
+ vrfyeq_(ind_linear_EmptyQ(),false);
+ vrfyeq_(ind_linear_N(),i+1);
+ }
+ // cursor
+ int count[100];
+ memset(count,0,sizeof(count));
+ ind_beg(_db_ind_linear_curs,item,_db) {
+ ++count[item.key.value];
+ } ind_end;
+ frep_(i,100) {
+ vrfyeq_(count[i],1);
+ }
+ // find
+ x=0;
+ frep_(i,100) {
+ x = Lcg100Next(x);
+ vrfyeq_(ind_linear_FindX(algo::U32LinearKey(x)).key,u32(x));
+ }
+ vrfyeq_(ind_linear_Find(algo::U32LinearKey(100)),NULL);
+ vrfyeq_(ind_linear_Find(algo::U32LinearKey(UINT_MAX)),NULL);
+ // remove by key
+ x=0;
+ frep_(i,100) {
+ x = Lcg100Next(x);
+ // leaks but we do not care
+ FHashableLinear *elem = ind_linear_FindRemove(algo::U32LinearKey(x));
+ vrfyeq_(elem->key,u32(x));
+ vrfyeq_(elem->ind_linear_next,(FHashableLinear *)-1);
+ }
+ vrfyeq_(ind_linear_FindRemove(algo::U32LinearKey(100)),NULL);
+ vrfyeq_(ind_linear_FindRemove(algo::U32LinearKey(UINT_MAX)),NULL);
+ vrfyeq_(ind_linear_EmptyQ(),true);
+ vrfyeq_(ind_linear_N(),0);
+ // remove
+ x=0;
+ frep_(i,100) {
+ x = Lcg100Next(x);
+ ind_linear_GetOrCreate(algo::U32LinearKey(x));
+ }
+ vrfyeq_(ind_linear_N(),100);
+ frep_(i,100) {
+ x = Lcg100Next(x);
+ hashable_linear_Delete(ind_linear_FindX(algo::U32LinearKey(x)));
+ }
+ vrfyeq_(ind_linear_EmptyQ(),true);
+ vrfyeq_(ind_linear_N(),0);
+}
+
+// Test hash with string keys containing binary chars
+void atf_amc::amctest_ThashStrkey() {
+
+ for (int pass=0; pass<2; pass++) {
+ for (int i=0; i<1000; i++) {
+ char key[6];
+ key[0]='\000';
+ (i32&)key[1]=i;
+ key[4]='z';
+ key[5]=i%256;
+ if (pass==0) {
+ Strkey &elem = strkey_Alloc();
+ elem.strkey = algo::strptr(key,6);
+ strkey_XrefMaybe(elem);
+ } else if (pass==1) {
+ Strkey *found=ind_strkey_Find(algo::strptr(key,6));
+ vrfy_(found);
+ }
+ }
+ }
+ {
+ Strkey &elem1 = strkey_Alloc();
+ const char key1[]="\000\001\000\017sub-000-zztt01g\000\032test-topic-0000000-7TLEyoo\000\000\000\001";
+ algo::strptr strkey1(key1,sizeof(key1)-1);
+ prlog(Keyval("key1",strkey1));
+ elem1.strkey = strkey1;
+ strkey_XrefMaybe(elem1);
+ vrfy_(ind_strkey_Find(strkey1)==&elem1);
+
+ Strkey &elem2 = strkey_Alloc();
+ const char key2[]="\000\001\000\017sub-000-zztt01g\000\032test-topic-0000000-7TLEyoo\000\000\000\004";
+ algo::strptr strkey2(key2,sizeof(key2)-1);
+ prlog(Keyval("key2",strkey2));
+ elem2.strkey = strkey2;
+ strkey_XrefMaybe(elem2);
+ vrfy_(ind_strkey_Find(strkey1)==&elem1);
+ vrfy_(ind_strkey_Find(strkey2)==&elem2);
+ }
+}
diff --git a/cpp/atf_amc/varlen.cpp b/cpp/atf_amc/varlen.cpp
index 38b5176e..ef80422c 100644
--- a/cpp/atf_amc/varlen.cpp
+++ b/cpp/atf_amc/varlen.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2023-2024 AlgoRND
+// Copyright (C) 2023-2024,2026 AlgoRND
// Copyright (C) 2020-2021 Astra
// Copyright (C) 2018-2019 NYSE | Intercontinental Exchange
//
@@ -18,7 +18,7 @@
//
// Contacting ICE:
// Target: atf_amc (exe) -- Unit tests for amc (see amctest table)
-// Exceptions: NO
+// Exceptions: yes
// Source: cpp/atf_amc/varlen.cpp
//
@@ -89,8 +89,7 @@ void atf_amc::amctest_VarlenAlloc() {
// template is needed for string literal in order
// to get correct length for NUL char inside
-template
-static void Check(T &bin_literal, strptr str) {
+template static void Check(T &bin_literal, strptr str) {
strptr bin(bin_literal, sizeof bin_literal-1);
// print bin and compare with str
{
@@ -185,3 +184,211 @@ void atf_amc::amctest_VarlenMsgsPnew() {
MsgLTV_v_curs_Next(vi);
vrfy_(!MsgLTV_v_curs_ValidQ(vi));
}
+
+template strptr atf_amc::Bytes(T &arg) {
+ return strptr(arg, sizeof(T)-1);
+}
+
+void atf_amc::amctest_Varlen2() {
+ // pnew
+ algo::ByteAry buf;
+ Varlen2Msg *msg = Varlen2Msg_FmtByteAry(buf,"Hello","My","World!");
+ vrfyeq_(s1_Getary(*msg),"Hello");
+ vrfyeq_(s2_Getary(*msg),"My");
+ vrfyeq_(s3_Getary(*msg),"World!");
+
+ // print
+ vrfyeq_(tempstr()<<*msg, "atf_amc.Varlen2Msg s1:Hello s2:My s3:World!");
+
+ // read
+ algo::Refurbish(buf);
+ atf_amc::MsgHeaderMsgs_ReadStrptr("atf_amc.Varlen2Msg s1:Salve s2:Mi s3:Munde!", buf);
+ msg = (Varlen2Msg *)buf.ary_elems;
+ vrfyeq_(s1_Getary(*msg),"Salve");
+ vrfyeq_(s2_Getary(*msg),"Mi");
+ vrfyeq_(s3_Getary(*msg),"Munde!");
+ vrfyeq_(ToStrPtr(ary_Getary(buf)),Bytes("\001\020\025\000\005\000\007\000SalveMiMunde!"));
+
+ // read in reverse order
+ algo::Refurbish(buf);
+ atf_amc::MsgHeaderMsgs_ReadStrptr("atf_amc.Varlen2Msg s3:Welt! s2:Mein s1:Hallo", buf);
+ msg = (Varlen2Msg *)buf.ary_elems;
+ vrfyeq_(s1_Getary(*msg),"Hallo");
+ vrfyeq_(s2_Getary(*msg),"Mein");
+ vrfyeq_(s3_Getary(*msg),"Welt!");
+ vrfyeq_(ToStrPtr(ary_Getary(buf)),Bytes("\001\020\026\000\005\000\011\000HalloMeinWelt!"));
+
+ // cursors
+ {
+ const char *s1="Hallo";
+ int i1(0);
+ ind_beg(Varlen2Msg_s1_curs,c,*msg) {
+ vrfyeq_(c,s1[i1]);
+ ++i1;
+ }ind_end;
+ vrfyeq_(i1,(int)strlen(s1));
+ }
+ {
+ const char *s2="Mein";
+ int i2(0);
+ ind_beg(Varlen2Msg_s2_curs,c,*msg) {
+ vrfyeq_(c,s2[i2]);
+ ++i2;
+ }ind_end;
+ vrfyeq_(i2,(int)strlen(s2));
+ }
+ {
+ const char *s3="Welt!";
+ int i3(0);
+ ind_beg(Varlen2Msg_s3_curs,c,*msg) {
+ vrfyeq_(c,s3[i3]);
+ ++i3;
+ }ind_end;
+ vrfyeq_(i3,(int)strlen(s3));
+ }
+}
+
+bool atf_amc::Arycmp(algo::aryptr a, algo::aryptr b) {
+ bool ret = elems_N(a)==elems_N(b);
+ for (int i=0; ret && i